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
25 views

Is there a setting to turn off block caching per block / block type in the admin UI?

I want to display the date in a block and make sure that it is always up-to-date (i.e. not storing an old cached value). Currently the date does not change, unless the cache is cleared ( via admin/...
1
vote
1answer
35 views

Adding a cache tag to an entity view display doesn't do anything?

I wrote a module that implements hook_entity_view_display_alter(). I modify the display settings of one of the fields depending on some configuration setting of my module. /** * Implements ...
0
votes
2answers
20 views

Solr search views cache issue

I have views for solr search result and I have highlight processor enabled. There seems to be cache issue effecting search result. Search results are rendered array of entities. For example: If I ...
0
votes
0answers
26 views

DrupalDatabaseCache::set running extremely slow since upgrading to MariaDB

I have a drupal 7 site that has been running fairly fast for the past 3 years. I'm up to date with all module/core updates. Since upgrading to MariaDB last September I noticed a decrease on ...
0
votes
0answers
45 views

Custom text/term ID cache

I have a view with the following: CONTEXTUAL FILTERS: Content: Has taxonomy term ID FIELDS: Global: Custom text = {{ raw_arguments.tid }} When developing, the output of Global: Custom text = {{ ...
0
votes
1answer
26 views

Custom block and menu caching

I have a custom block building a menu. The cache works fine until a menu item is enabled/disabled in the menu edit, e.g. admin/structure/menu/manage/main toggle the enabled checkbox and save. The ...
0
votes
0answers
29 views

how to set the cache:no-store in response header when serving a page through controller [duplicate]

We have a site in Drupal 8 where a few pages are being served using Drupal 8 Controllers. However, when the page is navigated using the browser backward and forward buttons, the browser (Chrome in ...
0
votes
1answer
32 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
70 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
59 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
10 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
1answer
24 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 ...
-1
votes
0answers
62 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
39 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
1answer
87 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
43 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
27 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 ...
-1
votes
0answers
61 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
16 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
62 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
85 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
49 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
26 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
32 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
24 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
25 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
153 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
93 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
34 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
211 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
20 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
394 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
35 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
100 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
104 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
45 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
74 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
73 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
211 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
46 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
256 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
35 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
86 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
40 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 ...