Questions tagged [cache]

The tag has no usage guidance.

22 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
164 views

Caching matrix that contains Freeform field

I've got a matrix block that most pages on my site are built from, and one of its blocks is a Solspace Freeform form field. I want to be able to cache the entire output of the matrix, but that makes ...
2
votes
0answers
174 views

Cache not invalidating when new entry is created

I realise this is probably a duplicate of the other questions just like it but I thought I'd raise it here before filing a bug with P&T. Basically, when a new entry is added to a section, the ...
1
vote
1answer
55 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 ...
1
vote
0answers
72 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
0answers
180 views

Error while sending QUERY packet. PID=881 when using cache key

If I do: {% set cacheKey = block.id %} {% cache using key cacheKey if craft.app.config.general.cache %} {% for item in items %} <div class="swiper-slide ais-hits--item" data-id="{{ ...
1
vote
0answers
384 views

What are my caching options when using CraftQL and React?

I’m experimenting with the CraftQL plugin and React with Craft 3, and I’m really liking the similar syntax to standard Twig element queries, and the fact I don't need to manually configure API ...
1
vote
0answers
485 views

Craft Nginx Cache Static Resources - Css, JS Errors

I'm currently trying to cache css and js files with the widely known config as follows: location ~* \.(png|jpg|css|js|jpeg|gif|ico|xls|doc|zip|exe|mp3|mp4|pdf|ai|psd|eps|ppt|dmg|csv|key|numbers|cur|...
1
vote
0answers
388 views

craft_cache / Integrity constraint violation: 1062 Duplicate entry, Serialization failure: 1213 Deadlock

Noticing these errors a lot it my logs. Any idea why, or how to stop it from happening? Jan 27 15:02:58 myapp.com ool: myapp: [craft] [error] [system.db.CDbCommand] CDbCommand::execute() failed: ...
1
vote
0answers
212 views

Craft Cache Dependency with Redis

I am trying to make dependency's work using Craft Cache (set to Redis.) I've tried: craft()->cache->set('cache_key', 'cache_value', 0, new CFileCacheDependency('dependent_cache_key')); This ...
1
vote
0answers
399 views

Set Cache-Control is being overridden

We are setting our Cache-Control headers in the layout file for all templates. However some templates the Cache-Control is being overridden. Why might this be? {% set expiry = now|date_modify('+10 ...
1
vote
0answers
204 views

Limit fields in query / Optimize query

What I'm doing is fairly simple: {% cache %} {% set jobs = craft.entries.section('job').find({ order: 'dateCreated asc', limit: 0 }) %} {% for job in jobs %} {{ macros.jobProfile(job) ...
1
vote
0answers
210 views

Performance and cache when using entry type templates and getSegment

I'm working on a site that will end up having 30-40+ structure sections which are sharing templates and will be using about 10 different entry types. (This would probably be much easier if I used ...
0
votes
0answers
6 views

Use “last-editorial-change” into cache key

Is there some kind of timestamp which reflects the last overall editorial change in Craft? I would like to use this for a cache key which automatically invalidates as soon as anything (Entry, Asset, ...
0
votes
0answers
12 views

Clear Cache on user profile update

Using a module, would it be possible to clear the cache of a particular user when that user updates their profile? A use case for this is we have a directory of users (authors) but if they update ...
0
votes
0answers
32 views

Every time cache gets cleared, Craft requires a “Project config sync” which leaves a 503 error meanwhile

It started to happen after updating Craft's version to 3.2. This is a problem for us since we clear caches often, and sometimes it doesn't get noticed and the site is down for a while. Our Craft ...
0
votes
0answers
82 views

ColdCache(?) error - count(): Parameter must be an array or an object that implements Countable

I'm getting a semi-persistent error that seems to be related to coldcache. Originally on PHP 7.2.6, though also present on PHP 7.3.5. I'm experimenting with different caching approaches and my ...
0
votes
0answers
19 views

How to cache location per guest in craft cache via plugin

I am looking at setting the currency of a guest site visitor. I have the look up and currency retrieval working OK based on the individuals IP. The problem i seem to face is how to cache the currency ...
0
votes
0answers
44 views

Cache not outputting chunks of content

I have a simple caching setup on this site. I have a layout template that extends it has this: {% block content %} {% cache %} <p>my content</p> {% endcache %} {% endblock %}...
0
votes
0answers
794 views

Folder Permissions for Assets, Cache, and temp

I have set 755 permissions to these folders and they are owned by the PHP web user. However, I'm still getting logs that say: [error] [application] Could not delete the file /var/www/craft/storage/...
0
votes
0answers
49 views

Caching of categories is not purged on adding new category

In a site we are currently developing I have setup a basic cache mechanism on each template that can benefit from it by reducing the number of db queries. The {% cache %} tag is basically in the ...
0
votes
0answers
45 views

Can you store cropped cloud assets locally?

Currently I'm seeing them cropped and stored on the remote bucket. Is there a way to force them to be stored locally and retrievable via an Asset URL method?
0
votes
1answer
242 views

Craft 3: Cache element query or variable assignment

Is it possible to cache a variable assignment and/or an element query with TWIG in Craft 3? With Yii2 this is possible, but is there a wrapper to TWIG? 2 use cases: {% set entries = craft.entries....