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
0answers
24 views

Can memcached flush_all command only operate on part of the distributed memcached memory pool? [migrated]

I have a Drupal site with a provider that operates off one of two servers (with balancers in front of that). Each server has an allocation of memory that is assigned to memcached, and the Drupal site ...
0
votes
1answer
54 views

Middle part of a page disappears and appears again after flushing all caches

Sometimes middle part of some page at our website may disappear and only header and footer are still displayed. The problem is always solved after flushing all caches. Our html.html.twig loads ...
0
votes
0answers
27 views

What cache tags can be triggered by a change in state variables?

If I want my render array to indicate to Drupal that it should be rebuilt when, say, node 1 changes, I can do something something like this: $my_render_array = [ ... '#cache' => [ 'tags' =&...
0
votes
2answers
43 views

How to cache View block by content language?

I have a very simple (block) view to list a node's title. This view has an id from url contextual filter and a single filter to filter on Content language set for the page (by URL prefix). This block ...
0
votes
0answers
15 views

Does Views block caching include language in cid?

I think this is likely a core bug (in which case I know it is not meant for Drupal Answers) but thought I would check here first to see if possibly I have just missed something in configuration? I ...
-3
votes
1answer
63 views

How to track recently viewed nodes using JavaScript on a completely cached website?

I want to make a block of recently viewed nodes on a website which is completely cached using Boost module (it saves a static HTML page for every request on the website). I don't want to disable Boost ...
1
vote
0answers
38 views

Setting latest revision has been delayed

We are (still) using Drupal 8, the latest version, as a CMS for content editing. Our platform is huge and it has 100+ editors who are constantly adding/editing content, and also 20 importers which are ...
0
votes
0answers
50 views

How can I debug cache tags not invalidated as expected?

Up unto last week my Drupal site and varnish_purge worked together fine with Varnish. After updating the modules to the latest versions, cache tag invalidation seemed to stop. Nothing else really ...
0
votes
0answers
24 views

Content and content type fields intermittently disappear after cache rebuild

I have an issue on a Drupal 9 website where sometimes (but not every time), if I run drush cr the content of pages disappears (the header and footer are all that remain), and in Structure > Content ...
0
votes
0answers
27 views

Is there a way to not render blocks for mobile devices that works for anonymous users?

I'm trying to dynamically render a block on for desktops. I've tried detecting in a page preprocess and using the set variable to dynamically render the block in the page template but there seems to ...
1
vote
1answer
48 views

Render view inside block with caching

My setup is a bit unconventional. I have a view displaying a block, relying on a contextual filter (let's call it product ID). I also have a custom block that renders this view programmatically ...
0
votes
1answer
49 views

Where to define custom entity caching rules of detail pages

When you have a larger project you probably have both internal page cache as internal dynamic page cache module enabled. In my case I do. But I have a section on my website containing custom entities (...
0
votes
1answer
72 views

EventSubscriber to add cache context for specific path

I am working with Mobile Detect module and from what I understand, we need to manually add the cache context mobile_detect_is_mobile in order to have the page cached differently based on the user ...
1
vote
2answers
107 views

Cloudflare cache everything

we have a Drupal 8 with Cloudflare cache rule. By default we have always GBP currency, then we developed a module that allow users change their currency with a footer dropdown and saves it on the user ...
0
votes
1answer
41 views

How can I have a custom block show different content on the front page?

I have a custom module, in Drupal 9, (showing a block in a region) that has an admin form with a checkbox for showing only on the "front page" or if unchecked on "all" pages. In ...
-1
votes
1answer
82 views

How to handle different output for a same block (Caching Problem)? [duplicate]

I have a theme which has two different appearance for main menu block, so I wrote a theme suggestion like this: function MYTHEME_theme_suggestions_menu_alter(array &$suggestions, array $variables) ...
0
votes
0answers
20 views

Using memcached and ip_ban simultaneously?

Memcached is by no doubt an essential tool to speed up Drupal websites. Is there a way to use the ip_ban module in order to block certain countries from accessing my website before the cached content ...
0
votes
1answer
67 views

Custom block is still caching for anonymous users despite getCacheMaxAge() being set to 0 and can't figure out why

I have a custom Drupal 8 block with class with build() and getCacheMaxAge() functions. getCacheMaxAge() is set to 0 but it is still being cached for anonymous users. If I put debug code in the build() ...
0
votes
1answer
118 views

How to invalidate Breadcrumbs cache for child nodes on graphQl

I have for example Node A with alias node-a and Node B with alias node-a/node-b so on my Node B i have this breadcrumb Home > Node A > Node B GraphQl result: "breadcrumb": [ ...
0
votes
1answer
88 views

How do I grant to a role the permission to flush the cache?

I removed the Administer site configuration permission from a role, but I need users with that role to flush the cache from /admin/config/development/performance. I know, there is hook_menu_alter() in ...
-1
votes
1answer
123 views

Can't get page html after updating the page and flushing all caches

Once I updated a page via admin panel, I need to programatically flush all the caches, then get the page source code and write it to a file. I use the following code inside of my module: function ...
3
votes
1answer
109 views

Can BigPipe exclude certain blocks?

I've got BigPipe enabled in Drupal 8, and it helps to make pages initially load faster. However, the header block is always one of the blocks that loads in on a delay, which visually looks bad since ...
0
votes
0answers
60 views

If I am using PrivateTempStoreFactory, should I be using the Internal Page Cache Module?

I found a Stack Exchange question here that kind of answers this question, but I was not clear about the answer from the exchange in the comments. Regardless of the reason I am using ...
0
votes
0answers
58 views

How is the cache invalidated?

Using the following code, are all the cache bins consider when invalidating a content piece? $variable['#cache'] => [ 'keys' => ['key string here'], 'tags' => ['tags string here'], 'max-...
0
votes
0answers
59 views

Create cache context for anonymous users based on ip range

I have a form within a custom block that is displayed on the front page of a Drupal 9 site on Acquia Cloud. I want to be able to have different displays for users coming from certain ip ranges. Is ...
2
votes
1answer
194 views

Debugging "UNCACHEABLE" header

We have a site where the homepage is not being cached and contains the headers: x-cache: MISS, MISS x-cache-hits: 0, 0 x-content-type-options: nosniff x-drupal-dynamic-cache: UNCACHEABLE I narrowed ...
1
vote
1answer
600 views

drupal9 dev mode local settings : non existing cache.backend.null

In drupal9 my drupal8 local.settings.php conf generate an error when i empty cache Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have [error] requested a non-...
1
vote
1answer
81 views

is it possible to deactive twig cache for a single theme custom template?

i am having a custom template for rendering a medialink url from a paragraph media entity ref field. In production with twig cache activated, modifiying the media attached file , does not update the ...
3
votes
1answer
73 views

How to invalidate the block list cache?

I need to invalidate the block list cache each time a new configuration entity is created, this is because I have a derivative block to handle dynamically one block for each of my configuration ...
0
votes
1answer
31 views

Class Drupal\dfm\EventSubscriber\DfmSubscriber not found when try to remove the Drupella File Manager

I installed the Drupella File Manager module for Drupal 8.8, but I have Drupal 8.7. I received this error. Call to undefined method Drupal\Core\File\FileSystem::scanDirectory() I don't need the ...
0
votes
0answers
33 views

Block vanishes after a few days, restored with a cache clear

I have a custom module that builds navigation and displays via a block. I do not think the parts that build the links are relevant to the problem as this block works as expected until a few days later ...
0
votes
0answers
58 views

Use Injected CacheBackedInterface to invalidate certain bin

I've got a content type called SERVICE (I write it all capitalized to prevent mixture with drupal service) which admin can introduce different SERVICE using this type, it is expected that these ...
0
votes
0answers
119 views

Antibot Failing when Webform Embeded in Gutenberg

When enabling Antibot on a Webform rendered through Guntenberg, I can not submit the form. Create a "Custom Webform" block type with a single entity reference field for Webforms. Create a ...
1
vote
1answer
51 views

Symfony\Component\HttpFoundation\Response is never cached

My custom controller is returning data but it is never being cached. My controller function: use Symfony\Component\HttpFoundation\Response; $build = [ '#theme' => 'search_form_suggest'...
1
vote
0answers
76 views

Clearing Cache related to user data

Drupal's cache system is a complete nightmare causing all sorts of issues with my user sessions. To provide a couple examples Our navigation header block contains a link that takes users to a ...
0
votes
1answer
165 views

How to deal with block cached for anonymous user?

I have placed in the site's home, via twig, a views block of nodes with a random sort and obliviously no cache active. Therefore, at each page reload different nodes appear. The problem is that block ...
0
votes
2answers
88 views

Is there any way to clear the cache with specific cid?

I set some data in cache using cache_set($cache_id, $temp_data, 'cache', CACHE_TEMPORARY); from a custom module. It's cleared when I clear all the cache. Is there any way I can clear that specific ...
1
vote
0answers
23 views

Cache rebuild take a long time and block all user request

The main problem I have is cache rebuilds, which take a while, and block all user requests until the rebuilds are complete. I would like to find a way to make it so the rebuilds aren't quite as deadly ...
0
votes
0answers
38 views

Is there a way to invalidate a render array cache by somehow passing the user.data information to the cache context and tags?

Is there a way to invalidate a render array cache by somehow passing the user.data information to the cache context and tags? Adding user:ID and user to the tags doesn't seem to invalidate when the ...
0
votes
0answers
19 views

How to configure Cloudflare module to work better with tag purging?

I've been trying to get cache purging figured out on my sites which are hosted on Acquia. I've installed Acquia Purge and the Cloudflare modules in an attempt to help with invalidating caches. This ...
0
votes
1answer
207 views

Clearing the render cache after being programmatically logged in

This issue is on a Drupal 8 site. I have no reason to think it would behave any different on Drupal 9. We have a scenario where we are having trouble with caching of a custom block. This block ...
1
vote
1answer
134 views

Token Replacement via Lazy_builder

I've spent the best part of the last day or two trying to implement lazy_builder (as seen in this brilliant tutorial https://github.com/joachim-n/drupalcon-europe-2020-lazy-builders). However, rather ...
0
votes
1answer
44 views

How can I invalidate cached field access grants for anonymous users?

We have a Drupal 8 application that uses an event subscriber class to validate IP addresses against a table of white-listed addresses on kernel requests, and adds that value to a session variable. ...
0
votes
0answers
42 views

Where do AccessResults for block access get cached?

AccessResult returned from BlockBase::blockAccess() can have cacheability data added to them. Where does that end up in the database cache tables?
3
votes
2answers
123 views

When "drush updatedb" is executed, are scripts cached by OPCache invalidated?

For sites that have PHP OPCache enabled: Does updating site using Drush require restarting the webserver to invalidate the scripts cached by OPCache? Does Drupal core or Drush invalidate OPCache ...
1
vote
2answers
164 views

Limit size of cachetags table

One of the site has fairly large cachetags table at over 418K records. Is there a way to limit the size of this table. This table is not cleared on cache clear. Since Drupal 8.4 there has been a way ...
1
vote
1answer
67 views

How can I have node pages with Fivestar or comment fields cached properly?

I was struggling with high page load time for my node pages when I realized that the problem was due to content pages not being cached (html render cache). The page is rebuilt after every single ...
0
votes
0answers
65 views

Drupal 8 purge module to allow SOLR index replication before cache invalidation happens

I am having a Drupal 8 website running over Acquia Infra. I have recently configured Purge module to invalidation cache over Acquia varnish and Cloudflare when cache-tags gets Invalidated. Problem: ...
0
votes
2answers
260 views

php.ini opcache path for multiple websites with shared code base

I have a D9 website set up already and I want to add another that shares the same code base. (This is on a shared hosting environment) Below is an example my current php.ini settings for the opcache ...
1
vote
0answers
23 views

Double Publish is Required To Update Data When Node is Under High Traffic

We have a high-volume production site that is running into issues of serving stale data when a node is republished. Description/Example Of Issue I go into a node, create a new draft, then make some ...

1
2 3 4 5
28