Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [caching]

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

0
votes
0answers
40 views

500 server error on cache flush [twig specifically]

I am getting a 500 error, The request timed out, The web server failed to respond within the specified time. This only happens if I flush all cache or flush twig cache, but not for css/js cache flush ...
0
votes
1answer
30 views

Capturing cache metadata from file_create_url?

I'm writing a Drupal 8 controller which takes in a media entity, and returns a redirect response to the actual file URL. It works by finding the file associated with the media entity, and then does ...
1
vote
1answer
66 views

Cache max-age doesn't correctly expire at midnight

I've got a node which cache should expire every day at midnight. Additionally I've a block showing the same node in another display mode, that also should expire every day at midnight. I thought this ...
1
vote
1answer
56 views

Dynamic local tasks - caching problems

I try to create some local second level tasks depending on some settings for a custom entity. But unfortunately sometimes these local tasks do not appear - they appear again when rebuilding caching ...
0
votes
1answer
9 views

After calling drupal_flush_all_caches, menu items with access callback TRUE are giving access denied error

I was building a custom module that affected the front page and I found myself having to go clear the caches for it to take effect. So as part of the code, I put in drupal_flush_all_caches(). After I ...
0
votes
0answers
10 views

Front page on a multilingual site intermittently displays incorrect language

I have a multilingual (English is the default language) Drupal 7 site. The language detection is set to URL, with the domain being the part of the url that detects language. Every now and then (...
0
votes
1answer
21 views

Is it necessary to clear site caches after putting site into maintenance mode?

I enabled maintenance mode on a Drupal 7 site; however, when I checked the homepage as an anonymous user, I noticed that the original homepage was still being displayed rather than the maintenance ...
0
votes
0answers
29 views

Randomizing a class and busting Drupal's cache

I am trying to put a random class on a node teaser so that we can display each node in a view differently. Each user should get a different look on each page refresh. I have tried it both in twig ...
0
votes
0answers
59 views

Block disappears unless I refresh route and link cache

I have a submenu based on the main navigation menu system. This Plugin Block builds the submenu on every page. The links of course change based on the route. Every hour around the same time, the ...
0
votes
1answer
34 views

How can I automate the “Clear Cache” everyday?

Currently we have to clear it manually everyday logging in to admin console and browsing to Home->Administration->Configuration->Development->Performance Is there way we can automate this job in ...
0
votes
0answers
13 views

Block resets after refreshing once

I recently changed the block settings on a drupal Page. After clearing the Cache and refreshing the page, my page displays the correct blocks. When I refresh once again the page reverts to the old ...
-1
votes
0answers
57 views

Drush command results in segmentation fault

Every drush command including drush help and drush status errors out with a Segmentation fault. This is happening only when Memcache API and Integration is enabled. Any fix for the issue or Memcache ...
0
votes
1answer
63 views

Disable caching of attached css/js libraries for custom module?

I have been trying to disable caching during development so I followed drupals guide step by step: https://www.drupal.org/node/2598914 After doing this I would assume that the caching is completely ...
0
votes
0answers
39 views

disable all server-side cache systems in settings.php

Is there a configuration that garantee having no cache at all enabled, including server-side cache such as memcache and apc cache ? I found out for example that this in local.settings.php have a ...
1
vote
0answers
23 views

Caching and Mysql binary logs [closed]

In my recent Drupal 8 project, we have the master-slave setup and we face binary-log files getting generated to a huge amount for every hour. On decoding these binary log files we figured out a lot of ...
0
votes
1answer
30 views

Media and cache keys

I'm using images inside of a Paragraph, and trying to use checkboxes in the Paragraph to control whether to display the credit and/or caption of the images. The problem is that the image gets cached ...
0
votes
0answers
39 views

Custom Block disappearing periodically even cache max-age is zero [duplicate]

There is a Drupal 8 custom block which is created by extends from BlockBase class in the custom module. To make this custom block uncachable, added below code line before return statement. $build['#...
0
votes
0answers
15 views

no data is stored in cache_form table (Ajax 200 error)

I am using Drupal 7.59 and Drupal Commerce 7.x-1.14. After we updated our PHP version from 5 to 7 and migrated our database to AWS RDS. We started getting a lot of Ajax 200 error(Invalid form POST ...
0
votes
2answers
57 views

Trigger a drush @sites cr --yes daily [closed]

Drupal 8. Title sums up pretty much my question. I'm wondering what is the best way to rebuild all my site's cache daily. A cron job with Truncate table cache ? Module who rebuild cache on each ...
0
votes
2answers
71 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 ...
1
vote
0answers
41 views

Style Sheet sometimes does not load Microsoft Edge Browser [closed]

I am using the Advanced CSS/JS Aggregation module to load css once the page has loaded: <link type="text/css" rel="stylesheet" href="/sites/default/files/advagg_css/...
0
votes
0answers
25 views

How to disable caching for a preprocessed template variable in a paragraph

I have a preprocess function for a paragraph that has a variable which contains a render array. I cannot seem to find a way to disable the caching of this variable when rendered on a page, it is ...
0
votes
2answers
30 views

Can't acces my site and without login and drush clear cache

I moved my local site to shared host. all code has been deployed to the staging server I changed settings.php import the database from local to the staging server database When I try to reach the ...
0
votes
1answer
14 views

cache_form has been truncated. Permanent error MYSQL Incorrect key file when a form is accessed

On a site I inherited, I can see cache_form is empty. It has been truncated some time ago. I have got an error crashing my site when accessing many type of forms: views exposed forms, forms to edit ...
0
votes
1answer
23 views

Memcache interfering with Simpletest

Adding some tests to an older Drupal 7 site and a few of the tests check for the presence or lack thereof of custom cache items. Having this in settings.php seems to interfere with Simpletest using ...
0
votes
1answer
22 views

Reassign $view_mode using entity field passed to hook_entity_view_mode_alter()

I'm using baseFieldDefinitions to create my custom entity form. With gracious help here, I've been able to successfully generate a radio button on the form which lets the user select what view mode to ...
0
votes
1answer
115 views

How work BigPipe cache around block views?

I have 2 blocks with swiper.js around. This 2 blocks are from the views module. I need to print them in the theme like i want so, i load them into the preprocess_page. $block1 = \Drupal\block\...
3
votes
1answer
56 views

Cache tags for all entities of a certain type

I understand how you can add cache tags to a custom query for a particular entity id (or list of them) but is there a way to add cache tags that will invalidate a query if any entity of type FOO is ...
0
votes
0answers
12 views

Possible to load newly implemented hooks without flushing the cache?

Curious if there is a better way than flushing/rebuilding caches to get a D8 site to recognize a new hook implementation. For instance, I just implemented hook_link_alter(), but it seems like overkill ...
2
votes
1answer
33 views

How to implement per user caching when restricting display of comments by author

I have threaded comments on a site where there are two roles, reviewers and administrators. Comments are shown in a view block added to the node (in this case a webform). The view format is set to '...
1
vote
3answers
137 views

How do I clear the cache for a single node?

In my module, I can call cache_clear_all() (D7) or drupal_flush_all_caches() (D8), and this would clear the cache for all the nodes. Is there a way to clear the cache for a single node? What I need ...
0
votes
1answer
19 views

D7 - does drush rr ALSO clear cache?

Someone just told me that in D7, drush rr and drush cc all do the same thing. I can’t find anything that explicitly states the difference, nor can I find anything that supports such a claim. ...
0
votes
1answer
233 views

How to correctly use cookies? (Twig and cache context)

In my current project I need to alter node templates depending on previously visited landing page. My idea is that, when a visitor visits one of these landing pages, a cookie will be set, and ...
0
votes
0answers
34 views

How to get the language from the cache?

I am working on the drupal 8 website, which is presented in 3 different languages. The issue for me is that when the user switches the language on the panel, some parts of the website (block in the ...
0
votes
1answer
88 views

Permissions/access caching per node and per user [closed]

UPDATE: Narrowing this a bit. I need to, for either (a) all nodes of a given type or (b) all nodes on a specified list of node id's or (c) all users on a list of iser id's, clear the cached ...
0
votes
0answers
82 views

Cache REST Response

Is it possible to cache the rest response other than CORS? Or is it possible to cache the response using memcache? Or is there a method available on rest for the caching? Update to include a sample ...
0
votes
0answers
43 views

Theme function ignored until cache flushed multiple times

I'm using the ShareThis module to power my sharing links on a Drupal 7 site, but I don't think my question is specific to this module. I want to modify the link that's shared and sharethis provides a ...
0
votes
2answers
61 views

Clear all “pages” cache [closed]

Is there a way on Drupal 8 to clear all "pages" cache or all "nodes" pages? I was thinking about a custom drush command but I don't understand how to do this.
0
votes
1answer
34 views

How do I clear the order cache?

I manually update an order using the following code. db_update('uc_orders') // Table name no longer needs {} ->fields(array( 'order_status' => 'payment_received', )) ->condition('...
2
votes
2answers
65 views

Which cache bin to clear after changing services

I made some changes to own services and now I get an error about invalid arguments. When I clear all caches everything works fine. I don't want to clear all caches in my production environment. Which ...
0
votes
1answer
178 views

Invalidate a specific cache tag on any saved taxonomy term

I would like to clear cache tag of a particular bundle when any taxonomy terms are update/ saved. I know the default node tag is saved like node:1, node:2, but I'm confused on how to invalidate a ...
0
votes
1answer
17 views

How to make a list of all nodes of content type ABC on a site (not a sitemap)?

I have a D8 website with about 100 landing pages for a Google Ads campaign. All of my landing pages are of content type landing page. I want to make sure that the cache is primed for these pages ...
0
votes
2answers
44 views

How to prevent dynamic library definition from being cached?

I have a use case where i want to dynamic add library , Attributes of library will vary with page. In my case the $callback will be different depending on the page. $libraries['sample.my-lib'] = [ ...
2
votes
1answer
197 views

Cache_page table gets massive [closed]

My cache_page table fills up immensely. I see that the expiry field has values = -1. I assume that means it never expires. Which could be why the table fills up so much. I wrote a hack to get around ...
0
votes
0answers
34 views

Clear cache deletes my translations

Good morning, My Durpal 8 is in English and French. French is the default language. I created a view with its translation, everything is correct except that when I clear the cache via config > dev > ...
0
votes
0answers
66 views

total view node count not refresh in Views

I used Views module to show list node and total view node. When I viewed node detail and come back to views list then total view node count not refresh. Total node count only update when I clear ...
0
votes
0answers
39 views

How to define caching for OutboundPathProcessor

I've got a customized OutboundPathProcesser that adds GET parameters to URLs starting from a specific node type targetting a specific node id. Basically whenever I'm on a node of type product, I add ...
-1
votes
1answer
30 views

js in default/files causes extreme slowdown of website [closed]

for the past week my website is plagued with over 4000ms hanging upon entering, more so at sometimes. After using firefox's performance monitor, I pinpointed it to several lines of code in a js file ...
0
votes
0answers
32 views

Setting custom block cache max-age to 0 breaks jQuery change event

I have a custom block in which I read a session value and display the result as the selected value of a select form element. Since the value can change based on the users selection, I'm setting cache ...
1
vote
2answers
371 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 ...