Stack Exchange Network

Stack Exchange network consists of 175 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.

-1
votes
0answers
15 views

Cache and deadlock related database errors [on hold]

We have a module that performs fairly complex operations underneath the hood. Sometimes the processes exit with database related errors, since there are no exceptions thrown by Drupal core we can't ...
-3
votes
0answers
27 views

How do I change header and footer based on URL?

I have a custom header and footer for the front page. I would like to change them for some pages. For example, initially I have the image a.png in the header; after clicking the entry form, the ...
0
votes
0answers
21 views

How to delete the cache files when the file cache module is installed

Hellow I have a site that someone else made and I receive it to manage it. Have configured the file cache module where the folder that stores the cache of data has a size of 30 Gigabytes. The site ...
0
votes
1answer
56 views

Disable Internal Page Cache and enable Internal Dynamic Page Cache with cloudflare CDN

Drupal 8.6.12 hosted on inmotion hosting VPS 2000 Website visitors/users are coming only from one country (Turkey) which is far away from the server location of inmotion hosting (USA). In below ...
3
votes
0answers
64 views

What does it mean if expire is set to null in a cache table?

I am looking at the documentation for the expire field in the cache tables and the documentation in CacheBackendInterface.php says: * @param int $expire * One of the following values: * - ...
2
votes
1answer
23 views

How do I clear a specific cache entry?

I saved a cache entry using cache_set(). How can I clear this entry using Drush?
0
votes
0answers
27 views

Preventing REST results from being cached [duplicate]

I have extended Drupal 8's REST services to provide any registered user a certain part of their own data. Let's say my endpoint is: /my_api/get_current_user_data?_format=json However, it looks like ...
1
vote
0answers
32 views

How do I cache web page for different header parameters?

I use AWS cloudfront with my drupal site. It sends below value with response headers. CloudFront-Is-Mobile-Viewer => true This value is true when you view your site with a mobile. And if this is ...
0
votes
0answers
19 views

Auto cron runs but doesn't clear the cache

behind the scenes i am accessing a service if (cache) stuff = cached.data else stuff = service.data auto cron is running; however, i notice the auto cron is not purging the cache. I have to go into ...
0
votes
2answers
48 views

Dynamically remove library based on user role, cache context not working

I want to remove all libraries of modules & themes, except those from modules/themes that are defined by me. This should only be done for anonymous users. All libraries should be served to ...
-3
votes
1answer
47 views

How do I clear the cache for a custom block?

I have custom block holiday this block is not updating once I'm updating data in database when I'm clearing the cache block is working. Is there any solution for this cache issue? I'm attaching the ...
0
votes
0answers
17 views

Advanced Meta Tags and Image Uploading

A little background: We have a Drupal 7 site with hundreds of thousands of nodes, each month we create between 5-8,000 new nodes that are essentially products we sell. These nodes are 80% clones of ...
0
votes
2answers
67 views

Page cache works on local dev but not on production

I've a Drupal 8.6.9 site running on Apache 2.4 and PHP 7.2. I've enabled the internal page cache, the dynamic page cache, and the BigPipe module in an effort to tease out some more performance. I've ...
0
votes
1answer
36 views

Is there a way to disable cache only for a single template file?

For my view I need to update my fields dynamically, for this reason I need to disable cache for views-view-field.html.twig, as it takes the parameter from a contextual filter. I send an argument from ...
0
votes
0answers
48 views

How do cached discovery definitions affect entity caching?

I'm experiencing an interesting and odd situation with entity (field value) caching. I'm using hook_ENTITY_TYPE_storage_load() to set the value of a field when nodes of a certain type are loaded. Per ...
3
votes
1answer
74 views

How do I avoid caching a redirect response from a form?

I have a Drupal 8 form used by authenticated users which sometimes needs to redirect based on the presence of absence of something in session. I don't want the redirect to be cached. My form is ...
3
votes
0answers
80 views

Warming up dynamic page cache for authenticated users

We're currently working on a rather complex Drupal 8 based website. After clearing caches, the majority of pages/routes require about 30-60 seconds for being rendered/returning the desired results. ...
1
vote
1answer
56 views

How to make use of the render placeholder system for cacheablejsonresponse?

I have custom controllers which provide CacheableJsonResponse responses. Those responses are quite heavy to build (couple of seconds), so I want to build them better. I build those responses by ...
0
votes
0answers
14 views

How to provide an uncached version of a view for preview purpose

A drupal 7 commerce shop has product pages which are made by a taxonomy view displaying commerce products; each of these products themselves consist of a view, so on the bottom line it's a nested view....
1
vote
1answer
44 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 ...
0
votes
0answers
38 views

How can I find out which cache is still active?

I have been walking through this page https://www.drupal.org/node/2598914 but I still have to hit clear cache during development process. vendor/bin/drupal site:mode dev PHP Warning: Module '...
1
vote
0answers
45 views

PHP Type Error with Cached Plugin definitions in DiscoveryCachedTrait.php

We have the following set up for Drupal 8.6.3 - IIS Server, MSSQL Server, sqlsrv drivers. However, every few hours, Drupal throws PHP errors(all of them belonging to the same kind) and most pages from ...
0
votes
0answers
36 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
65 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
42 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
1answer
38 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
36 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
40 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
91 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 ...
2
votes
2answers
123 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
13 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
32 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
1answer
89 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
186 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
49 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
31 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
2answers
65 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
196 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
138 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
30 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
41 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
21 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
30 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
31 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
262 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
171 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
39 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
551 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 ...