Caching is the use of a faster data store to improve response time, by reducing the amount of processing.

learn more… | top users | synonyms (1)

1
vote
2answers
30 views

Prevent block from caching

I have a custom block that reads information from the database. As the user will be filling out a form, refreshing the page and viewing the block it cannot be cached. How do I fix this? I have tried: ...
0
votes
0answers
11 views

How to change cache context array for home page

I have Drupal setup using multisite so that the contents vary with sub domain. I need to use 'url.site' in 'cache context'. But cache context array contains 'url.site' only for node pages. In home ...
-1
votes
0answers
19 views

How to change the cache context to 'url'?

I need to change the cache context of a Drupal 8 site to 'url'. How can I do that?
3
votes
1answer
43 views

Invalidate block cache programmatically

I have a block that is cached per page. However, I need a way to invalidate it's cache in code per page or node. (Or, if no way, all cache per block id).
0
votes
0answers
17 views

Flush cache does not call custom theme functions

I have a Drupal 7 theme which is child of Bootstrap theme. When I flush cache from Configuration > Development > Performance, the primary menu disappears and the design of a custom menu breaks; when I ...
1
vote
1answer
25 views

What is the correct way to cache blocks by language?

I have a multilingual site with custom blocks in the right-hand menu - the content of which is generated dynamically through the build() function of BlockBase and which changes depending on the ...
0
votes
1answer
23 views

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table

In my site, I get the following error: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cambodia_ohchrProduction.ohchr_cache_block' doesn't exist: TRUNCATE {cache_block} ; ...
0
votes
0answers
15 views

Views ajax took long time to respond on first search, and loads normal for next searches

I am using views exposed filter to render list of branches for a particular city or zip code. After clearing cache when I search for any city it tooks around 15 - 20 Sec's to render a view, with the ...
0
votes
1answer
13 views

Views Block Caching issue for not logged in User

We are using Drupal inbuilt caching with Memcache. Our website home page has more than 5 blocks created using Views for which we have enabled Time based caching. But the contents are not getting ...
0
votes
1answer
20 views

Authcache will cache user menu

I have used Authcache and memcache to cache pages for authenticated users. However, I have a user specific menu displayed at top right of every page, and the menu sometimes displayed a wrong users' ...
0
votes
1answer
136 views

Help understand/solve this Warning: Invalid argument supplied for foreach() in views that requires class registry clean to mend

Out of nowhere without any changes to the view or the views data I suddenly started receiving this error: Warning: Invalid argument supplied for foreach() in views_handler_filter->...
0
votes
1answer
36 views

Clearing cache removed all styling

I'm fairly new to Drupal, but when trying to install a new module, I was instructed to clear the cache. Now, all of the styling on my website is missing and I don't know what to do.
1
vote
2answers
17 views

How do I correctly add cache information for breadcrumb parts?

Visiting a node Foobar a breadcrumb gets created which adds the parent menu structure like so: $currentPluginId = $menu_link->getPluginId(); $trailIds = $this->menuActiveTrail->...
0
votes
0answers
22 views

How do I turn off caching of twig templates [duplicate]

I'm on mac with MAMP. I've tried to follow this : https://www.drupal.org/node/2598914 and this : Turn off Twig cache settings.local.php (i have not cut off comments in my file) : assert_options(...
3
votes
1answer
67 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
22 views

How to add a cache context from an existing menu?

I want to update my breadcrumb when the menu structure changes. This did not work: $breadcrumb->addCacheContexts(['route']); Whats the correct way? Edit: some more context (pun actually ...
3
votes
2answers
40 views

Anonymous user cache issue

We're having a problem with caching that is affecting anonymous users. We have a form in a block that when the user fills out the form, they are able to download a PDF. We hide the block on pages ...
0
votes
0answers
27 views

Refreshless doesn't work

I just tried to setup the RefreshLess module for my Drupal 8 site; after enabling it, I just see that some meta information is added to the DOM, but switching pages using links seems not to be ...
1
vote
0answers
15 views

Detect language when cache is enabled for anonymous

I have a multilingual site in which I need set cache page enabled for anonymous using Varnish. But if you enable page caching language is not detected for anonymous in pages without language prefix. ...
0
votes
0answers
45 views

Cannot redeclare class Doctrine\Common\Annotations\Annotation\Target

I'm regularly experiencing this PHP Fatal error: Cannot redeclare class Doctrine\Common\Annotations\Annotation\Target in ?uD on line 31 This ?uD string is random. I've seen so far among others: @...
0
votes
0answers
19 views

Best caching module when certain fields are country specific

I have a site with a couple of fields that are not visible to visitors from other countries. I have used the ip2country module and some custom code in my template.php file to acheive this "file hiding"...
0
votes
1answer
15 views

Autcache + Varnish modules installed but cache tables growing

I have a site in Drupal 7, multilanguage and multidomain, and when I do a weekly manual database backup (apart from the automated ones), I see that the size of the mysqldump file is of about 200 Mb. ...
2
votes
2answers
78 views

How do I programmatically set cache age?

Drupal 8: I have the code for a block successfully doing its work and returning it. The block is called "RacerProfile" and it dumps all its content into variable "$pageContent". At the very end it ...
2
votes
2answers
99 views

cache_render database table growing in size

I am having a drupal 8 website where cache_render table is growing to GBs. I am not sure why this growing huge, any starting pointers would be helpful. Thanks
0
votes
0answers
12 views

Cache sometimes is not being updated on saving operations

This is a problem I'm struggling with for a few months already. I'm maintaining a pretty big news website, with a lot of content and multiple editors. The website is using paragraphs (which I don't ...
1
vote
1answer
29 views

Stop Varnish from caching 302 redirect from POST responses

drupal_goto() uses a 302 redirect by default, which means a lot of redirects, including form redirects, get served with a 302 response code. Having a issue in Varnish that is caching 302 response ...
1
vote
0answers
41 views

Using PrivateTempStore for anonymous users with Internal Dynamic Page Cache & Internal Page Cache modules

I'm developing a Drupal 8 project which interacts with an external API. This API handles user authentication, completely bypassing the Drupal user system. This means that logged in API users are ...
0
votes
1answer
44 views

Leverage browser caching issue [closed]

I added some lines in my .htaccess file, following Leverage browser caching on a drupal site, but Page speed tool still throws "Leverage browser caching error." for only images.
4
votes
3answers
67 views

Installed Boost Caching, but now my dynamic blocks and webforms are also cached

I just installed Boost module for Drupal 7, but now my Webforms and dynamic blocks like commerce shopping cart block isn't working. It's most likely cached, but what are some methods of getting these ...
0
votes
0answers
16 views

Reset all the cache related configurations

I am using Drupal 7 in my website. I enabled the cache option and unfortunately the website is down after some time. The hosting company told me that the website is eating too much of CPU, hence it is ...
3
votes
1answer
32 views

How to clear or rebuild a cached block for a specific user?

I have a block with the cache setting DRUPAL_CACHE_PER_USER. I want to clear the cache when a user performs a specific action. I want to clear the cached block only for the acting user, keeping the ...
2
votes
2answers
241 views

How do I get the current path of a block?

I need the current path, where my custom block is visible. So, i have written this code class MyBlock extends BlockBase { public function build() { $currentPath= \Drupal::service('path....
0
votes
1answer
22 views

deadlock with cache clear

I am trying to clear the cache or view status reports in D7 i get the below error. PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting ...
0
votes
0answers
19 views

Varnish is working but X-Drupal cache is missed

I have configured varnish on a Digital Ocean server and installed Drupal varnish module. I have confirmed that varnish is running but once i do a test on my site using blazemeter.com the server CPU ...
1
vote
1answer
21 views

Clear block cache in panels page

I'm having trouble with refreshing content in a block created with a custom module, placed within a panels page. My end goal is to display either regular or seasonal hours based on a set date range. ...
1
vote
1answer
45 views

Using cache tags for a particular node list

Caching in Drupal 8 is great, but documentation is thin (at this time) on using cache tags for render arrays in Drupal 8. I have some code that basically generates a list of node teasers, say for ...
0
votes
0answers
32 views

Page cache is not working over HTTPS

I have a Drupal 7 site that is served over HTTP and HTTPS protocols using default ports (80, 443). Cache is enabled of anonymous users. However, the whole cache functionality works only for HTTP ...
1
vote
1answer
36 views

What is the intended use of drupal_static?

I understand Drupal static cache is used to store static values in the memory for the length of the request to faster access them. However throughout Drupal and contributed modules I tend to see two ...
5
votes
2answers
150 views

Limit caching for a specific page

I'm working on a module, which includes a page that displays a select from a database table. The page content is getting cached for long periods, so is out of date for users. What's the simplest way ...
0
votes
0answers
15 views

Disable Cache for a specific block [duplicate]

I'm working on new website with Drupal 8 my site is now on production. I have a block of type php that read data from an xml file. I activated both cache (Internal and Dynamic) ,so every time i change ...
1
vote
0answers
9 views

ESI callback does not work from a theme

I use https://www.drupal.org/project/esi module. I have declared the function: function _my_devel_esi_test() { return 'ESI test is successful!'; } , which has the callback $items['my-...
1
vote
1answer
25 views

Is there any way to count the number of items in cache?

In Drupal 6, I used to be able to look up the number of items via {cache_MODULENAME} table direct in SQL. Is there any way to look it up via the cache API?
0
votes
1answer
30 views

Unable to clear cache

I am facing an severe issue with Drupal instance. I am trying to clear the cache and the page is redirecting to error page. This site can’t be reached The connection was reset. ERR_CONNECTION_RESET ...
5
votes
4answers
252 views

How do I correctly setup caching for my custom block showing content depending on the current node?

I have this very basic block which just shows the current node's ID. <?php /** * @file * Contains \Drupal\mymodule\Plugin\Block\ExampleEmptyBlock. */ namespace Drupal\mymodule\Plugin\Block; ...
2
votes
1answer
90 views

Cache remains stale for custom blocks after editing

My Drupal 8 website consists of multiple custom blocks created from the drupal backend user interface. As I went from dev to production settings and activating Internal Dynamic Page Cache (set to 1 ...
1
vote
1answer
30 views

Manage 2 separate page cache for the same URI

We have a multilingual website build with Drupal 7. We have a IP detection for detect Chinese users. Chinese laws do not allow the use of certain JS librairies. In our case, for one page, we use ...
1
vote
0answers
11 views

Alter field value without save it, but caching it

I want to alter a body's node value, but without saving it: the altering depend of a array of values, witch it could change sometime, so i have to update every node at each change if i save it. ...
1
vote
2answers
50 views

How do I invalidate cache of an embedded view?

I have a node type "Article" that contains a repeating Paragraphs field. One of the paragraph types let's the user embed a view using a entity reference field. When rendering an Article node ...
0
votes
2answers
37 views

clearing cache to call hooks in .module file

I have created a token in .module file. that gives current node title. But every-time I change the title of node, I have to rebuilt cache so that updated title get reflected in my token. Of-course ...
0
votes
1answer
28 views

Anyway to clear cache on Drupal 7 without any extra modules or even going to the performance page?

I'm looking for a way to clear cache easily without installing any fancy modules or going to the performance page. Is there a URL I can just visit to clear the cache? Basically try to find the ...