Questions tagged [cache]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
20 views

Craft CMS: Data too long for column 'cacheKey' at row 1

We have Craft CMS v3 using multi-sites. We are using cache to cache whole pages based on the absolute URL as some URLs have query parameters which seem to be ignored when not using a key. So the ...
11
votes
3answers
3k views

Is there a way to force Assets to redo transforms?

Client has uploaded a number of severely badly lighted photographs for a 'staff' section of a site and these all have had a 'staffThumb' transform applied to it on the sites pages. I corrected the ...
1
vote
1answer
40 views

Separate cache per user or user group in Blitz cache

We're using Blitz cache for a client website. Works fine. Now we need to introduce variable content for different users (based on user groups) Is it possible to have different cached versions per ...
1
vote
2answers
32 views

Prevent caching from inside of the cache tag

Does anybody know, if it is possible to prevent caching from within the cached code/content? Something like: {% cache ... %} ... {% do notCache %} ... {% endcache %} Why? Because if there is a ...
13
votes
1answer
6k views

What are the cache options available to a Craft installation?

Reading the Craft docs and other related questions on Stack Exchange there seems to be a lot questions about caching, what it does under different scenarios and how to best utilize it. Is there an ...
1
vote
1answer
135 views

How do I flush the query cache?

How do I flush Craft's query cache so that I may query a relationship field again in the same web request with a new set of parameters? In this particular scenario, I need to handle it inside of a ...
2
votes
1answer
114 views

How does the new caching works (3.5+)

Just upgraded to Craft 3.5+ the pages are cached (instant load on a 2nd run) but the templatecaches and similar tables are empty. How exactly does it work now? How do I flush cache for 1 specific page ...
0
votes
0answers
24 views

How to configure Craft to work with Redis replicas?

We have an existing load balanced / HA deployment of Craft 3.4, to which I want to add support for the redis replica we have available, but I can't work out how to correctly configure this in config/...
2
votes
1answer
31 views

Clear cache tool missing

I'm trying to clear templates cache. The Craft CMS 3 documentation says: You can also manually clear all of your template caches from the Settings page, using the “Clear Caches” tool. When I go into ...
1
vote
1answer
23 views

I am getting this message when creating a new project

Cannot create cache directory /home/cmnd/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
0
votes
0answers
30 views

How to stop caching entries/templates?

I have a dynamic form that creates entries in Craft 3 Pro. These entries are displayed in a "Profile Page" for each user, but it only shows the newly created entries after hitting refresh 2 ...
0
votes
0answers
28 views

Paginate and Cache Together and SEOmatic helpers

I am struggling to get this working correctly. If I keep the element queries outside the cache tag then this naturally stops the cache being broken and so is not a viable option. However, when I put ...
3
votes
2answers
1k views

Resolving “Stuck” Background Tasks

Hi guys so I am having an issue with the "generating pending image transforms" being stuck. I've seen the solution listed here https://craftcms.com/support/stuck-tasks telling me to go to the ...
0
votes
0answers
19 views

Has anywhere users successfully run Craft 3 on CyberPanel / OpenLiteSpeed?

I've been trying to get a Craft CMS 3 project running on CyberPanel 2.x (with OpenLiteSpeed v1.6.14). For the most part everything has gone well. Where I get stuck is with the LiteSpeed caching. The ...
0
votes
0answers
81 views

Multisite with unique domains not working with Forge config

I have a live install with a primary domain of https://marketing.vessul.co/ which works great. When I've added another site to this install and it's location is another folder such as /extra-site it ...
1
vote
1answer
41 views

How to prevent cache busting (preferably on a single section)?

I have a template that displays 1,100 entries as dots on a zoomable/searchable map. The query is cached and it performs beautifully. As expected, if I edit any of those entries the cache is busted and ...
1
vote
1answer
44 views

How to prevent Craft from injecting scripts in the page?

I have a website that resides behind a static cache. Today, I realised that some of the cached pages contain this bit of JavaScript at the end: <script type="text/javascript"> /*<![CDATA[*/ (...
1
vote
1answer
74 views

Uploading Asset Doesn't Clear GraphQl Cache with VueJS/Axios

Context: I have a VueJS method that uses a form and Axios to upload an asset to an entry's asset field. The method successfully uploads the asset to the entry, and I can prove that fact via the ...
0
votes
0answers
14 views

Cache Control Panel resources

Is it possible to enable Browser Caching for the cp resources? Did not find anything in the documentation about it and my custom set headers in nginx does not work for them. I am working with craft 3 ...
0
votes
0answers
10 views

Cached Images falling back to IP

I'm having a strange problem which I'm unsure if it's my hosting or my Craft's config. My images which I have within a Cached template, once the cache expires or sometimes before they go back to the ...
1
vote
0answers
16 views

How to append current version to post URL - versioning a post

I'm middle of a PWA app and one of the problems facing is versioning, once the post cached using Service Worker and if any change amended(ex: if it is an event post, the event end date may be extended....
1
vote
1answer
44 views

Craft 3 Cache Busting for Pending Entries

So in Craft 2 the following code was required to cache bust if an entry was set to pending or post at a future date. {% set firstPending = craft.entries({ section: 'projects', status: 'pending', ...
8
votes
2answers
3k views

Why does Craft set no-cache headers for all requests?

Craft seems to be setting headers to tell the browser not to cache anything it serves, which seems bad. Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Why it do dat?
1
vote
1answer
102 views

Deleting stale template stuck fatal memory error

So all my background tasks Craft 3.2.6 seem to process ok except deleting stale template caches. Although craft is supposed to fail after 5 minutes, it fails instantly and the error log shows ...
1
vote
1answer
31 views

Craft 2: What would prevent most cached template chunks from showing up in the `templatecaches` table?

I am working on a Craft 2 site that is exhibiting some rather poor performance characteristics. On production, we use memcache for caching, and monitoring on the server shows disappointing cache hit ...
1
vote
1answer
63 views

Server's IP in URLs in cached templates

I'm running Craft CMS 3.3.11 on an EC2 machine with Apache and Load Balancer. After upgrading to Craft 3, I'm having issues with caching. I use relative paths to resources/assets in my templates (...
1
vote
1answer
65 views

Is there a CacheService equivalent in Craft 3?

CacheService is exactly what I need to cache a custom API endpoint in PHP, but I don't see it in Craft 3. What would be the correct way to do this in Craft 3?
1
vote
1answer
53 views

Using {% cache %} tags around {% template %} includes (or in Header)

I was wondering if it makes sense to wrap these {% cache %} around {% include %} tags that call a separate file with params. Is it better to just include them in the actual file itself? For example, ...
1
vote
1answer
38 views

Is it worth caching product blocks for use on a category page?

So we have a Commerce project that shows lots of products per page/category as per any standard store. Each product block comprises: Product name Product price Brand (via category field) [eager ...
1
vote
1answer
106 views

templatecachequeries entries with of 157.000 characters in query column

after enableling querycaching in craft3 I found rows in templatecachequeries with big amount of characters in the query field. I decoded it with base64 and got this as the largest entry: query_length:...
1
vote
1answer
15 views

Cache Records Being Stored for Invalid Paths

I'm trying to figure out why I have so many template cache records and when I look in my database templatecaches table I'm seeing a bunch of rows being stored for paths that don't exist. For example ...
1
vote
1answer
35 views

Why Does Manual Cache Clear Work But CP Task Fails?

I've been having a problem with my site not properly clearing out its template caches. The task list gets stuck on "Pending" when trying to execute the "Deleting stale template caches" task. If I ...
1
vote
1answer
202 views

Generating a precache manifest for service workers

I'm thinking of using Google's Workbox to pre-cache a bunch of files, and I've been scratching my head as to how to generate unique hashes for files when they change. Something like this: workbox....
1
vote
1answer
54 views

Craft 2.6 Session Issues

We are having issues staying logged in to Craft (2.6). There was a plugin error which is what we thought was causing the issues, so we removed the sprout SEO plugin. However the error still persists. ...
1
vote
1answer
69 views

Page with Matrix field slow to load

I am fairly new to Craft CMS but have a good understanding of it. I have a page that has a Matrix field to display staff photos and their roles. On the initial load of this page, it is slow, it takes ...
1
vote
1answer
341 views

How to cache a Guzzle Http request?

In my module I have the following: $client = new Client(['base_uri' => myBaseUri]); $response = $client->request('GET', myQueryString, [ 'headers' => [ 'Accept' => ...
1
vote
1answer
88 views

Clear template cache after update sale on Craft Commerce

How can I clear products template cache after update sale ? Because product price don't change ... Thank you.
1
vote
2answers
297 views

Help setting up Memcached in Craft 3

We want to use Memcached but are struggling to find Craft 3 specific config examples and documentation. The docs mention several things that seem to lead to dead-ends: App config docs here show ...
1
vote
1answer
71 views

Redis cache memory usage

I’m runnung a few Craft sites with Redis cache enabled. It works fine. Except that Craft only uses around 3mb of Redis memory, with peaks up to 5, while there’s 128mb available. Is there a way to ...
4
votes
1answer
1k views

Cacheing in PHP code for plugin

I have a plugin that makes several and potentially slow database calls that eventually return 8 Entries. Is there a way to make use of Craft's built in caching on the plugin side? Using the {% cache %}...
1
vote
1answer
73 views

Craft update process affecting Element API cache

I have a site A using the Element API plugin to feed content to site B via JSON and handlebars templates. The process is both sites are up to date with content 'x' and it works fine. When I run the ...
2
votes
1answer
255 views

How to I set the location folder of Control Panel resources?

I'm trying to use the ./craft clear-caches/all CLI command. Everything is working fine, except that I always get this error: Error clearing cache Control Panel resources: Unable to clear Control ...
1
vote
1answer
143 views

Excluding Array of Entry Ids Not Busting Cache

-- UPDATED -- My understanding of how the cache busting works is to make sure the query is within the {% cache %} tag. When looking into how it works I may not really be understanding the ins and ...
1
vote
1answer
20 views

Craft localisation caching error

long time listener, first time caller. I'm having some issues getting localisation setup on my homestead/vagrant craft 2 site. I'm running into issues, I believe, with the craft cache when I try to ...
2
votes
1answer
1k views

Craft CMS 3 - Redis Sessions cause error

I've configured Redis to handle cache and sessions for Craft 3, and while cache configuration is working as expected, I had to disable session configuration due to the below error. It fails on the ...
1
vote
0answers
82 views

Avoiding includeJsFile, includeJS from caching

In my template, I have an includeJSFile that loads properly on the first load, but disappears on subsequent loads. The includeJSFile is outside the caching tags, so I'm not sure why this is still ...
1
vote
1answer
91 views

Failed Stale Template Cache Delete Error…Analyzed…But No Answer

For some of the extremely static content on my site, I use caching to prevent multiple db queries during every single load. I also have multiple locale on my site with custom cache key names. The ...
4
votes
2answers
769 views

Static page caching using Nginx FastCGI Cache with CraftCMS

This isn't Craft issue per se. But I was wondering if anyone can help me out. I’m trying to enable FastCGI Cache in my server. My nginx server block is coming from this helpful article: https://...
2
votes
1answer
207 views

Craft 3 - Cache tag increasing number of database queries

I have a question about the {% cache %} tag with Craft 3. I am reading this article (https://nystudio107.com/blog/the-craft-cache-tag-in-depth), and trying out implementing the tags; however, when I ...

1
2 3 4 5