We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [caching]

Improving the response time, by reducing the amount of processing, in Drupal normally requires using a cache.

Filter by
Sorted by
Tagged with
0
votes
1answer
531 views

Request referer gets cached

I need to grab referer and save it for the first time (I save it to sessions) and when the user gets to a specific page forward it. My problem is that after opening page with the same referer few ...
4
votes
1answer
50 views

Is there a way to partially rebuild the router or invalidate a route cache?

I'm using the Groups module (http://dgo.to/group) to set up groups on a SaaS project I'm working on. I've set up a domain field on the groups, allowing groups to have vanity domain. As such, groups ...
21
votes
2answers
9k views

drupal_static() uses a FUNCTION variable,what does it mean?

function drupal_set_page_content($content = NULL) { $content_block = &drupal_static(__FUNCTION__, NULL); $main_content_display = &drupal_static('system_main_content_added', FALSE); ...
0
votes
1answer
95 views

How to serve content type for authorized users as for anonymous?

I have content type "book". It's nodes are huge and it's takes a long time to format them by input filter. Caching works only for anonymous users. So my goal is to give authorized users the cached ...
1
vote
0answers
51 views

Invalidate cache of views block for anonymous users

I have a view display block that needs to be updated every 8 hours. I tried Views Custom Cache Tag module https://www.drupal.org/project/views_custom_cache_tag but I could not make it work. I set my ...
1
vote
1answer
61 views

Cache-Control response header includes “private”

Why does a vanilla Drupal 8 site add cache-control: must-revalidate, no-cache, private to all the pages? A Drupal 7 site adds cache-control: must-revalidate, no-cache. Is that addition of private ...
2
votes
2answers
622 views

hook_node_insert() sporadically not being fired after node_save()

I have a situation where, every once in a while, I'll save a new node, and hook_node_insert() appears not to be called--AT ALL, for any of the modules that implement it. For example, if I look through ...
1
vote
1answer
48 views

Preventing redirects from being cached for anonymous users

I have a content type that needs to redirect only when it is tagged as "External". All of these "External" items have a field where a URL is supplied for the redirect. During initial setup of the ...
1
vote
1answer
893 views

Menu theme suggestion ignored when cache turned on

I have an alternative main menu that is used on specific node types. When turning on the cache the menu block is cached. The theme suggestion for the menu is then ignored. I tried to disable the menu ...
0
votes
1answer
436 views

Boost + Domain Access + flushing cache

I have the Boost and Domain Access modules working correctly. But I've found that if the cache is flushed for one domain it doesn't clear for the others. So if content is added to one, it won't show ...
5
votes
3answers
3k views

Turn off Twig cache

I did Disable Drupal 8 caching during development step by step ( also finally rebuild the cache) but yet my changes in twig files not take effects without rebuild the cache. sites/default/services....
0
votes
1answer
498 views

Cache is not cleared

I have a weird problem that the cache won't be cleared. It all began since I added a template file "field--custom-field-name.tpl.php". The field is attached on user entity type. I put var_dump(...
1
vote
1answer
528 views

Alter view with hook_views_post_render and save results to cache

How can I alter the results of a view with hook_views_post_render but save the altered output to cache, in order to avoid the overhead of altering the results on every request? The ideal scanario ...
2
votes
2answers
667 views

Add cache context to altered links

I am using hook_link_alter(&$variables) to alter links depending on the user's role. I'm doing this for links in the main menu as well as for custom links shown on entities. This works good except ...
0
votes
2answers
592 views

How to disable CACHE in VIEW PAGE display

DRUPAL 8 I am using VIEW module to create a page which loads data from a database table. Seems this view page is caching because whenever I add a new record in this table via custom input form, it ...
0
votes
1answer
757 views

$.cookie is not a function from form.js with block cache

I am getting this error if I turn my block caches on. I have traced back the origin back to Drupal core form.js but can't seem to see what's going on here. Any ideas? Here is the debug: form.js?v=7....
0
votes
1answer
96 views

How do I disable caching for the Forum module or, alternatively, how do I fix caching?

I use the normal standard Drupal Forum module with a clean Drupal 8 installation. After I have installed it, I have a problem where "2 new posts" shows for all users. In other words, the /forum page ...
1
vote
1answer
99 views

hook_js_alter is getting cached

I recently come across a issue where my page was rendering two boostrap.js (Offcourse bad coding). An external Js from a module and another js from twitter bootstrap theme. Its causing some of the ...
0
votes
0answers
26 views

Invalidate local_task cache for a specific entity

Is there a way to invalidate local_task cache for a specific entity? The issue is that an additional local task is defined by a different module that has a custom access check. That custom check if ...
1
vote
1answer
676 views

Why am I getting a 200 status header when the page is being served from cache?

Been running into a weird issue with all of our Drupal 8 websites, hosted on different servers. The pages are caching correctly, x-drupal-cache header shows a HIT as well. The page however has it's ...
2
votes
1answer
717 views

CSS still requiring clearing cache after following steps to switch caching off

I have followed the steps detailed in this tutorial and many others -> https://knackforge.com/blog/rajamohamed/disable-drupal-8-cache-during-development I have copied and renamed the sites/example....
1
vote
2answers
637 views

How to display the output of my module without clearing cache and refresh page?

I created a very simple module which generates a tag cloud based on user input; you can see the code here. // wow.module function wow_menu() { $items = array(); $items['wall/of/words'] = ...
0
votes
0answers
37 views

Region with menu block disappears suddenly, re-appears after re-saving menu

We have a website with a menu in a block, that is placed into a region "Sidebar". My customer notified me that the whole region containing the menu keeps disappearing on the live site, on average once ...
0
votes
1answer
650 views

The directory public://xmlsitemap was not found or is not writable by the server

I have just installed XML Sitemap on a EC2 drupal 8 instance. I am seeing the following error message in the admin report status page: XML sitemap cache directory Not found or not writable The ...
1
vote
1answer
363 views

Aggregated CSS & JS files revert to old version

I'm troubleshooting an odd issue on my Drupal 7 site where it seems that old versions of our aggregated CSS & JS files are used some amount of time after a cache clear. How this is playing out is ...
0
votes
1answer
663 views

Fatal error: Call to undefined function wincache_ucache_get()

After downloading fresh files and restoring fresh database from prod website, on my local server (IIS) I have a problem. Fatal error: Call to undefined function wincache_ucache_get() in E:\XXX\...
0
votes
2answers
168 views

How to disable panel cache for user menu?

I have a panel page and this page is front-page of my site. This page is not for anonymous users and having a user menu with welcome message like. Welcome [Username], then other user related menus. ...
1
vote
1answer
530 views

How to add image cache headers?

When doing SEO tests, we consistently seeing a message for cache headers on images. We were thinking of implementing but cannot find the appropriate way to test this as the x-cache still gives a MISS. ...
0
votes
0answers
47 views

Caching based on roles

How would it be possible to unset the "Cache-Control: must-revalidate, no-cache, private" that drupal adds for logged in users, for a specific role? I want a specific role, to follow the non-...
1
vote
1answer
579 views

Cache not clearing on expiry

Using the steps explained here: http://www.lullabot.com/blog/article/beginners-guide-caching-data-drupal-7 I'm storing an array with specified expiry time. But what is happening is that even after ...
0
votes
2answers
1k views

Fatal error: Maximum execution time of 240 seconds exceeded in sites/all/modules/memcache/memcache.inc on line 353

I am using multidomain site . After adding a new domain record, I was asked as follows: Content access permission needs to be rebuilt on this page. When I clicked on Rebuild Permissions button, the ...
2
votes
1answer
535 views

ssl with boost and securepages module

I have this doubt. I have a website in drupal 7 currently live (Kickstart2) and use as cache management boost I have to buy a ssl certificate on my domain and with this certificate I would like to ...
0
votes
2answers
641 views

Cache pages for anonymous users stuck on

I can't turn off the "Cache pages for anonymous users " cache option. I uncheck it and then hit save as usual but it stays on. Is there some sort of module conflict causing this or possibly an issue ...
2
votes
1answer
58 views

Have followed instructions to disable cache for development but it's still caching

I have followed all the instructions here https://www.drupal.org/node/2598914 I'm developing a module with a block, and when I went to the Block Layout page and clicked "Place Block", the list of ...
1
vote
1answer
958 views

How to access an entity loaded out of the cache

I am working on a Drupal 8 modules which should push a http response header based on a value stored in an entity or a list of entities. The module was originally done for D7 and now is in porting up ...
0
votes
2answers
920 views

Clearing cache breaks site

I'm trying to load a production site in a dev environment using the site's codebase (core 8.3.7, contrib and custom modules and vendor folder) and the current database. After struggling a bit with it,...
1
vote
2answers
537 views

How do I overwrite a lazy service?

I'm trying to have my D8 site use Memcache for the lock service backend instead of using MySQL which is the default. In core.services.yml we have the lock defintions: lock: class: Drupal\Core\...
5
votes
2answers
2k views

TrustedResponseRedirect failing - how to prevent cache metadata?

I am getting the following when trying to redirect to an external site from my controller function defined in my routing file: return new TrustedRedirectResponse($my_ext_url); LogicException: The ...
0
votes
1answer
722 views

How to setup Recaptcha on pages cached by Varnish?

On a site where a contact form is displayed at the bottom of each page, I implemented Varnish caching. To do so I had to deactivate Recaptcha to avoid 'no cache -must revalidate " headers. I tried ...
2
votes
1answer
379 views

Where are the Page Manager “Caching options”?

In D7 I'm using Ctools, Panels (3), Views, Page Manager etc., but in Page Manager when gear-icon-clicking the content panes I don't find any "Caching options" as I have seen described. What reasons ...
1
vote
2answers
280 views

How can I make a response cachable by browsers?

I am working on a Drupal Controller implementation that would return a generated image as response. I used Symfony's Response and I was trying to add ETag header to it: use Drupal\Core\Controller\...
0
votes
2answers
837 views

Disable block caching

I just made a simlple block by using block > custom block, so I didn't make it programmatically. I am a Drupal 8 newbie, and I look for a simple and clear solution how to disable caching for that ...
3
votes
1answer
114 views

How can I let authenticated users rebuild caches?

Is there a way for authenticated users to clear the cache without giving them the administer site permission?
2
votes
2answers
4k views

How can I stop JavaScript from being cached during development?

I have a Drupal 8.00-beta11 site and am trying to dynamically add JS to a page, so that I don't have to clear the cache every time I edit the JS file. I have a custom module (lets call it my_module) ...
0
votes
2answers
243 views

chmod() and touch() operations not permitted [closed]

After updating drupal8 for 8.7.0 and then to 8.7.1 versions i have next errors: Warning: chmod(): Operation not permitted in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line ...
3
votes
1answer
940 views

Showing local tasks in toolbar with hook_toolbar: caching problem

I'm creating a module using the toolbar api showing all administrative functions in a more compact toolbar. I'm having "cache" troubles showing the local tasks in the toolbar... How can I keep these ...
1
vote
1answer
57 views

Cache pages/variables in hook_preprocess() for anonymous user

So I am having trouble understanding the caching of variables set in hook_preproccesses for anonymous users. It seems that the entire page is cached, and not rebuilt, even when set to no caching. With ...
1
vote
1answer
328 views

drupalSettings cached in page

I have a module that adds functionality to the front-end. The feature can be turned on or off via the configuration page of the module. I pass the settings to the frontend in the HTML preprocess ...
2
votes
1answer
62 views

Remove the cache for a particular Twig file

I'm showing the name of the currently logged-in user in header, using \Drupal::currentUser()->getUsername(), but it's showing an already cached page. I know I can disable the cache for a ...
0
votes
0answers
35 views

Caching user profile image? [duplicate]

If I log in as User 1, i see user 1's profile picture. If I log in as User 2, I see user 2's profile picture. As expected. But after browsing a bit, User 2 would suddenly see User 1's profile picture. ...