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
1answer
21 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
1answer
33 views

The contact block isn't displayed after clicking the button Clear all caches [closed]

I see in the page source code that the HTML code is ended before the place where the form should be. If I comment the line containing {{ drupal_block('contact_block') }} in Twig template, the HTML ...
-4
votes
0answers
20 views

How to clear the cache after logging in? [closed]

How to clear the cache after logging in on Drupal 7? Is there a related cache context?
0
votes
0answers
31 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
40 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
56 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
34 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
69 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
77 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
25 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
16 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
33 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
12 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
61 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
87 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
38 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
40 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
84 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
50 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
66 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
42 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
141 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 ...
0
votes
0answers
47 views

Node cache never expires and can't be cleared

BEFORE YOU ASK: I can't use Drush, this is a shared hosting, but I can use Composer. In the constant struggle with Drupal 8.9 (8.9.11 to be exact) I've stumbled onto yet another issue: I have a simple ...
2
votes
0answers
81 views

When should I use the “node_view” cache tag?

When should I use the node_view cache tag? $build['#cache'] = ['tags' => [ 'node_view', // ... ]]; Drupal core uses the following code, in the EntityViewBuilder class. public function ...
4
votes
1answer
173 views

What are my options for a url based cache tag?

I have a controller that serves a path, /get-messages, which requires a query argument, path. An example request to this path will look like /get-messages?path=/about/team. I have a content type, ...
5
votes
1answer
110 views

What effect does BigPipe have if my traffic is mostly anonymous and I'm serving unpersonalized content behind varnish?

I've looked into this before and I swear, though I can't seem to find any documentation to confirm it now, that I read BigPipe only helps performance for authenticated users. (Note: I'm sure I'm just ...
0
votes
0answers
135 views

Is there a way to apply cached access results to listings?

Code that is put in either hook_entity_access or an access handler has no effect on listings such as views field displays and search. I am not sure if this is by design or due to an error from my side,...
0
votes
0answers
34 views

View shows different data to administrator users and anonymous users

I have created a simple page that only shows JSON. The issue I have is that administrator users and anonymous users see different data. I assume this is a cache problem, but I am not sure, nor am I ...
1
vote
1answer
110 views

Redirection cached?

I have 2 versions of site (with same code), one for Switzerland (.ch) and other for rest of the world (.com). What I need is that if someone from Switzerland visits .com is redirected to .ch And other ...
0
votes
1answer
51 views

Deployment Issue with Heroku

I have a Drupal project on heroku and it works fine, until a dyno restart. After that, the Css and Js on the Drupal site stop working. Whenever that happens, I have to do a flush cache to get the site ...
0
votes
1answer
84 views

how do I specify a render cache context as universal?

I want to a render array in my page to be cached, and I know that it's the same for every user in every circumstance. How do I specify that its cache context is universal, rather than anything else?
0
votes
1answer
58 views

Custom block disable caching?

I've created a custom module to show On This Days in a block but they are not changing each day until I flush the caches. I call the entity: public function build() { $query = \Drupal::entityQuery(...
0
votes
0answers
34 views

Relative date filter views block is cached for anonymous users

Drupal 7.74, views 3.24 (latest) I have a view which uses a date field to filter and shows on: less than or equal to "now" I display the view in a block. With caching for anonymous enabled, (...
0
votes
1answer
61 views

How to use hook_field_preprocess to add a prefix/suffix to an entity reference field for different view modes?

I'm trying to move some markup from twig templates to hook_preprocess_field(). I have an entity reference field (media image) that I want to add a prefix and suffix to. I added a prefix and suffix ...
3
votes
1answer
124 views

Disable caching for a front page path processor

I’m working on a project where users can create a book (core functionality). In a simple text field they can connect a domain to this book. This way the book is only accessible via this domain. For ...
-1
votes
1answer
50 views

How to update the TWIG flag conditions?

I have this code in my sub theme : bootstrap_subtheme_front_office_old.theme <?php /** * Implements hook_preprocess_HOOK() for user.html.twig. */ function ...
0
votes
1answer
91 views

Problem with cookie and session cache [duplicate]

I have a problem with the Drupal cache. The cache remembers session and cookie values. Everything works fine when I'm logged in or when I completely turn off any cache. Is it possible to use cookies ...
1
vote
1answer
43 views

“drush cc” fails

Does anyone know why Drush doesn't recognize the Drupal 7 installation when I run drush cache:clear? It gives me the following error message. Command cache-rebuild requires Drupal core version 8+ to ...
2
votes
1answer
115 views

How to Output Realtime Computed Field Value

I have created a computed field (computed_field module) and I'd like the calculated value of this field to be computed on the fly for each of my views results. Specifically, I have a start time, and ...
0
votes
1answer
45 views

Getting Miss always in varnish cache for the page using REST API

While hitting URL using REST API, it is always giving Miss for varnish cache for specific path and giving response from Memcahce. In header if we can check for cache-control we are getting "must-...
0
votes
1answer
45 views

Clear entity cache before render

I secured some file in an s3 bucket using s3fs. My problem is : the "Expires" argument send to build the file URI is not reset each time the object is call in my API. time doesn't change if ...
1
vote
1answer
221 views

Returning custom array in lazy builder callback

I have to return a custom array from a lazy builder callback and then loop through that array in a Twig template for a custom block. Here is my code so far: Custom block: public function build() { ...
0
votes
1answer
41 views

Tabs: invalidating cache tags does not lead to a rebuild of the tabs

I have a custom route defined with a custom access check. Apart from some more checks one of the rules for accessing the path is that a specific custom entity exists. The access check does the ...
0
votes
0answers
87 views

Dynamic block cache doesn't render

I have a menu that renders different items based on the entity association of the node being rendered. I've been trying many difference combinations of cache configurations for my custom block: ...
0
votes
0answers
39 views

Implementing hook_entity_type_build causes 500 error on cache clear

I recently attempted to display custom form modes based on the currently logged in user. My searching led me to implement hook_entity_type_build. However, I am finding that even just having this ...
0
votes
1answer
42 views

URL-dependent templates only evaluated once, incorrectly cached

I have a twig template that controls the HTML of the page based off of some URL-specific information. However, this template seems to be evaluated once on the server and then gets cached, never to be ...
0
votes
1answer
263 views

Cloudflare Clear Cache For One URL, Convert Curl Command to Drupal::httpClient() Or php

I am creating a custom module to clear caches on cloudflare for one url. The original curl command: curl -X POST "https://api.cloudflare.com/client/v4/zones/123456789/purge_cache" \ -H &...
1
vote
1answer
26 views

Convert Acquia Clear Varnish For One URL Curl Command to Drupal::httpClient()

I am trying to convert a command to php curl or Drupal::httpClient(). The original command Curl -k -X PURGE -H "X-Acquia-Purge:[site-name]" --compressed -H "Host: example.com" ...
0
votes
1answer
69 views

Are page caching and cache tags related?

I'm working with a site which has page cache enabled. I'd like the page cache for any given node to invalidate when that node is changed. There's a lot of examples out there dealing with cache tags, ...

1
2 3 4 5
28