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.

-2
votes
0answers
23 views

Selection, storing, caching of custom fonts

I would like you something about font paths and font caching in Drupal 8 (8.7.2). My aim is to use a custom font, without using the @font-your-face-module. Just for trying out, on my local ...
-5
votes
0answers
33 views

Suggestion - Caching based on user

In my application a part of the header changes based on user to user. I have created a REST API service to collect the JSON data that builds the header based on that. I just want a suggestion whether ...
0
votes
1answer
30 views

How can I purge a specific URL from varnish cache without making a curl request?

I'm programmatically updating images and keeping the same file name. I flush the image styles for the image when I do this, but I'm running into an issue where my image styles aren't being regenerated ...
0
votes
1answer
17 views

How do I enable the ETag header?

I'd like my JSON:API responses to return the e-tag header so that consuming remote sites can determine (e.g. with a HEAD request) if they need to ditch their cached responses and re-fetch. There is ...
0
votes
0answers
19 views

How to move js in header from footer in D8 [duplicate]

I am using twitter bootstrap theme in drupal 8. By default bootstrap.js and jquery.js loaded in footer. I want to override the order of these js and place in header. Please let me know if its ...
0
votes
0answers
39 views

Caching input filter results

I'm creating an input filter that is quite expensive, as it makes a call to a remote service as part of the processing of the output. In Drupal 7, I'm pretty sure that the filtered output of an input ...
2
votes
1answer
60 views

Why doesn't LinkFormatter::viewElements bubble cache metadata?

I am trying to understand how the token system in Drupal 8 interacts with the cache bubbling system and in LinkFormatter I see $link_title = \Drupal::token()->replace($item->title, [$entity->...
1
vote
1answer
36 views

Wrong User Image Display - Weird Twig Cache?

I'm having a weird issue with incorrect user images being displayed and it seems to be a caching issue or perhaps I am passing the user image incorrectly to my template. Problem: If I login to a ...
0
votes
0answers
42 views

redis vs memcached vs varnish

As a contractor one jumps between different installations of drupal for different clients. Often the architecture is baked in and needs to be maintained. My experience tells me caching solution used ...
0
votes
0answers
22 views

Check for cookie value(s) for a visitor and attempt to authenticate them?

I have a case where when a visitor comes to the site from a subsite (different application), if they are authenticated (there will be a cookie value), I need to get this cookie value and initiate a ...
0
votes
1answer
59 views

Drupal 8.7.0 chmod() and touch() operations not permitted

After updating drupal8 for 8.7.0 and then to 8.7.1 versions i have next errors: Warning: chmod(): Operation not permitted in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line ...
0
votes
1answer
34 views

Are there specific cache tags which get reset on user login?

Scenario I'd like to invalidate a set of caches based on user id upon user login. I'd like to avoid creating new tags, and limit new code as much as possible. Presumably the way to do this is with ...
1
vote
0answers
32 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 ...
0
votes
1answer
10 views

How to store your own key-value pairs in Redis using PhpRedis with D7 Redis module

We have the D7 Redis module installed, which is being used as the cache mechanism for D7 caching. That module uses PhpRedis as the underlying library. I would like to use that same Redis instance to ...
0
votes
1answer
35 views

Referenced entities show old value when changing properties

I have three custom entities, all generated with Drupal Console. I only added some basicFieldDefinitions to them before testing some CRUD operations on them. I have these entities: ConfigEntity (...
0
votes
1answer
16 views

Configuration settings of Authcache for roles

I'm not sure about configuration of roles in Autchcache module, specifically with authenticated user role. I want to enable caching for both anonymous and authenticated users, but I want to exclude ...
1
vote
0answers
36 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 ...
0
votes
1answer
41 views

Editing contents of custom block referenced in paragraph type, doesn't reflect changes in node where displayed

So, I have a Custom Block type, let's call it Sidebar Links Block. In an Article, we have a Sidebar paragraph type that allows quite a few different entities, one of which is the Article Sidebar Links ...
0
votes
1answer
43 views

How do I disable the cache?

I have created the settings.local.php file inside the default folder and uncommented the the following lines. $settings['cache']['bins']['page'] = 'cache.backend.null'; $settings['cache']['bins']['...
3
votes
1answer
118 views

How to condition output based on a URL query string

In my node preprocess function I check the value of a query param... $variables['exclude_urls'] = \Drupal::request()->get('exclude_urls'); And in my template, I have... {% if not exclude_urls %} ...
0
votes
0answers
29 views

Efficient way to get entity information

Which is an efficient way to fetch entity label and id? Database query or entity query with entity load? I need to get the list of all taxonomy terms in an associative array of ID and Label. I can ...
0
votes
0answers
31 views

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

You have a site with the filecache module that saves the cache in files instead of the database. The filecache directory to date has a size of 30 Gigabytes. You want to disable the module filecache ...
0
votes
1answer
122 views

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

Drupal 8.6.13 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
71 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
28 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
30 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
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 ...
0
votes
0answers
23 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
101 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
52 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
19 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
69 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
39 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
50 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
127 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
99 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
68 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
16 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
116 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
41 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
55 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
71 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
99 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
75 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
84 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
45 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
47 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
110 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
193 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
20 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 ...