Questions tagged [caching]

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

14
votes
0answers
1k views

How do I setup Chained fast backend, Varnish, APCu and Redis cache bins in settings.php?

On a Debian Jessie server (Nginx, PHP 5.6, Zend Opcache), I installed Apcu, Redis, Varnish. I also installed APCu, Chained fast backend, Redis and Varnish modules. In order to make these caching ...
3
votes
0answers
72 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: * - ...
3
votes
0answers
102 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. ...
3
votes
0answers
645 views

Configuring Varnish for Drupal with Proper Module Usage (Expiration Cache, Varnish, Purge, Memcache)

Can someone help me straighten out my setup? What is needed...what isn't? Varnish has been working well with a high hitrate average, but I am really trying to dial in my configuration. Any insight ...
2
votes
0answers
111 views

Custom placeholder markup when leveraging #lazy_builder in elements

Using bigpipe. To avoid blocking page loads for long-lasting API calls, etc, I implement: $element = [ '#lazy_builder' => ['service.admin:method', []], '#create_placeholder' => TRUE, ]; ...
2
votes
0answers
885 views

How to properly cache AJAX request responses with the controller from my custom module?

I've got an drupal 8 project with an custom module. There I have an controller which returns specific data we need there. In my js file, I have 7 AJAX requests which are called when someone visits the ...
2
votes
0answers
355 views

D8 use Memcache for sessions only

I need to use memcache only for sessions. We have PHP 7.1, php-memcached and Drupal 8 with Memcache module. In session.php we put: $settings['memcache']['servers'] = ['192.168.177.112:11211' => '...
2
votes
0answers
184 views

hook_link_alter() and render cache

I'm using hook_link_alter() to add specific HTML classes based on the current URL. Unfortunately this no longer works once render cached. Since this is not a render array, the #cache key doesn't ...
2
votes
0answers
211 views

How to reduce the memory used by a site with many domain aliases

I have a Drupal 7 site which runs on a Centos 6 x64 server with 4GB RAM, Apache, Memcache and Opcache. The drupal site has a base domain 'example.com' and 2000 domain aliases (parked domains) which ...
2
votes
0answers
128 views

Site falls over on loss of single “key” memcached instance in distributed cluster

I have a Drupal 7 site sitting behind HAProxy that is load balancing across 4 web servers. Each of these web servers is also running a memcached instance. All the Drupal applications have been ...
2
votes
0answers
78 views

How to change cache context array for home page

I have Drupal setup using multisite so that the contents vary with sub domain. I need to use 'url.site' in 'cache context'. But cache context array contains 'url.site' only for node pages. In home ...
2
votes
0answers
59 views

Custom module data storage

In Drupal 6, I'm writing a custom module that generates several pages (as a Drupal newbie). Mainly public form pages for soliciting donations - users fill out their info (amount, frequency, etc.) and ...
2
votes
0answers
76 views

Drupal cache problem, strange issue

I have a site on Drupal 7. After migration on new server I have some issues. Site works normally and everything is ok, but after some time I can't see images, can't upload new images and don't work ...
2
votes
0answers
172 views

Amazon S3 module how does the local cache work and where is it at?

I'm using the Drupal Amazon S3 module and just wondered where/how the local cache works. Does it reduce file gets to S3? From what I can see there is an amazons3 table in the db and I can see ...
2
votes
0answers
471 views

Drupal and cache in node_load

I have written a simple module for counting node views. For each nid I store 2 numbers: impression and view. 1 Impression is when the node is loaded and visualized in any display mode (teaser, views ...
2
votes
0answers
75 views

Calendar dateobject performance issues

I am using Drupal 7 and unfortunately there are problems with the calendar module. The calendar itself is used in a relatively small enviroment of 20-40 users, which are all registered userers with ...
2
votes
0answers
96 views

Varnish and expire module adding starts with on regular expressions

I have varnish running with the expire module that sends bans into varnish when an article is published. The problem is that it doesn't expire all versions of an article. Some articles could be ...
2
votes
0answers
113 views

Clear cache changes link language prefix in field

We have a multilingual Drupal 7 install. On a lot of pages there are internal links to other pages in a textarea field, like the body field, example: When the node is saved, the internal link is ...
2
votes
0answers
1k views

recommend drupal form cache disable?

I have static page and form but in each load in devel show a lot of query (select and Insert) in cache_form table I see form_set_cache and operation but I think may disable cache_form completely is a ...
2
votes
0answers
145 views

Site not loading with memcached

I'm trying to install memcached and having no luck getting the site to run in local development using OS X 10.9 Mavericks. The homepage loads, but that's it. Everywhere else, I get this error: ...
2
votes
0answers
369 views

Problem with theme registry rebuild and drupal_get_form in a block

I'm calling a form from a custom block and having real problems getting it to function with theme registry rebuild on each page load turned off. With the registry rebuilding every page load this ...
2
votes
0answers
210 views

How can I prevent Boost front page cache being cleared on logout?

Drupal 7, Boost 7.1.beta1, cache_expiration 7.1.alpha3 - Boost seems to work for the most part except that the boost cache is cleared too often for the front page (other pages too, but less frequently ...
2
votes
0answers
206 views

Random lost _page_build implementation in cache

We have an interesting trouble on couple of our sites. The hook_page_build implementations sometimes looses some value from cache. Using this cose, I get the following result: block, ...
2
votes
0answers
207 views

Drupal 6 APC with domain access module not working for (sub-)domains

I've recently enabled APC in my environment and using it with cache backport and APC beta 7.x-1.0beta3 which is a backported version for D6 modules respectively in site running drupal 6.22 which uses [...
2
votes
0answers
292 views

Boost and Varnish together in Presflow

One of my client drupal 6 site boost installed and working properly. Now they need to integrate varnish to the site. For that the site is upgraded to pressflow. The varnish is installed in server, and ...
2
votes
0answers
632 views

How to speed up json views in drupal 7

I am trying to get json response from my drupal7 site using Views. Example : www.mysite.com/company company refers to a view which was created using json document I also applied caching to the ...
2
votes
0answers
439 views

FileField/ImageField error: “An unrecoverable error occurred. Form missing from server cache”

After creating about 20 nodes and uploading an image in each of them (using FileField/ImageField), I get this error when trying to create another node with an image: "An unrecoverable error occurred. ...
2
votes
0answers
29 views

cache memory and linking of two sites

I have linked my drupal 7 website using xampp with php and hosted on hots gator. Where is the caching of memory happening?And how can i link the database of two sites, both made using drupal?
2
votes
0answers
1k views

How to optimize the unserialization of “variables” cache value

As we all know, the whole variable table is being cached in the drupal cache system and is being extracted into global $conf variable in each invoke. In one of our production site with the domain ...
1
vote
0answers
34 views

hook_js_alter is getting cached

I recently come across a issue where my page was rendering two boostrap.js (Offcourse bad coding). An external Js from a module and another js from twitter bootstrap theme. Its causing some of the ...
1
vote
0answers
37 views

Caching of sub site menus

Preamble We currently have a Drupal 8 site that has subsites (accessed via subdomains). On the main site (non-subdomain) we have a main navigation menu defined (this is presenting correctly on the ...
1
vote
0answers
33 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 ...
1
vote
0answers
56 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 ...
1
vote
0answers
44 views

Does Drupal Cache work with views rendered programatically?

I want to understand does the Drupal caching work for views which are called programmatically I am using views_get_view for my implementation plus hook_views_query_alter to further add a where ...
1
vote
0answers
226 views

How do I add CacheableMetadata to an array I'm returning in a rest resource?

I'm getting the following error, which I've seen in several other questions, but as yet I haven't been able to make any of the example solutions work: LogicException: "The controller result claims ...
1
vote
0answers
586 views

Leverage browser caching

I'm trying to leverage the browser cache for my Drupal 8 site. I saw many posts regarding it, but whenever I edit the .htaccess file, there is still no difference in testing. This is my code right now....
1
vote
0answers
25 views

DRUPAL_CACHE_PER_PAGE on a block creates cache records for every image style on page.. Totally ruins cache. [Fixed: Happens when images are missing]

I'm leaving this here in case someone searches.. These images weren't on my dev but when I copied them over, the cache stopped getting polluted. Woohoo. When I enable DRUPAL_CACHE_PER_PAGE, my cache ...
1
vote
0answers
34 views

How do I use memcache in a custom block?

I have installed and configured memcache. I have not got any single tutorial of memcache with custom block. I want to understand how memcache can be integrated with a custom block and views.
1
vote
0answers
54 views

When and where does Drupal decide to use a cached version of a page?

I am working on a module that works relatively well on the site, but is failing all functional tests I write, because it keeps serving cached versions of pages. As far as I can tell I have properly ...
1
vote
0answers
121 views

Restfull cache error

I have a custom get resource API. The resource working fine. Whenever I clear cache, resource doesn't work and show error. The controller result claims to be providing relevant cache metadata, ...
1
vote
0answers
36 views

How to: Setting an Expires Response Header for a Views block?

On another question I received the following advice: Create a module drupal generate:module, create the route subscriber drupal generate:route subscriber and to look up the route name of the view ...
1
vote
0answers
67 views

Hooks in the render pipeline

What hooks are there in the render pipeline in between (A) hook_entity_display_build_alter, hook_entity_view, hook_ENTITY_TYPE_view, hook_entity_view_alter, hook_ENTITY_TYPE_view_alter, and (B) ...
1
vote
0answers
15 views

Unusual redirect is tripping up Boost

My employer maintains a Drupal site we did not develop so we don't fully understand it. Recently I installed Boost on the dev site, it improved page load speed tremendously, but when I installed it in ...
1
vote
0answers
212 views

Can't get Authcache to work with Memcache as backend: Cache Status: “MISS”

I have tried to set up Authcache with Memcached as backend. But when I use the debug feature I always get Cache status: "MISS". Am I supposed to use the "built in cache backend" allthough I am using ...
1
vote
0answers
44 views

Drupal 7.0 Views 7.x-3.14 Time-based cache is not functioning as expected

I must admit some of this caching stuff is over my head, so this may be a misunderstanding on my part of how this is supposed to function. But essentially I have a View with the following traits: ...
1
vote
0answers
61 views

Bad detection of language when anonymous user cache is switched on

I have a website with Domain Access, Domain Locale and the default language is Spanish, second language is English. The detection is done by suffix ( www.example.com/es , www.example.com/en ) and the ...
1
vote
0answers
16 views

Remove caching for newly created node and updated page and block for quick access

I have caching enable. However I wanted my changes to show up without delay. How can I remove caching for specific : page like the home page (too dynamic) blocks any time they are updated new ...
1
vote
0answers
34 views

HTML wrapper not added to views row

In drupal8 site, I have views for showing blog content created a twig file and wrapped with some HTML tag for theming the blog page. Consider I have 10 content on one page. During particular interval ...
1
vote
0answers
54 views

Keeping sensitive data from appearing in cache_form table

I'm developing a HIPAA compliant site using Drupal 7 that collects some personal sensitive data from users, and this data should be protected. I've already encrypted the data before it's stored in the ...
1
vote
0answers
44 views

Flush cache does not call custom theme functions

I have a Drupal 7 theme which is child of Bootstrap theme. When I flush cache from Configuration > Development > Performance, the primary menu disappears and the design of a custom menu breaks; when I ...