Questions tagged [cache]

The tag has no usage guidance.

1
vote
1answer
27 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....
0
votes
0answers
21 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 ...
1
vote
1answer
31 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
57 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' => ...
0
votes
1answer
27 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
31 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
51 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
31 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 ...
2
votes
1answer
72 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
29 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 ...
1
vote
1answer
66 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 ...
0
votes
0answers
78 views

Cache Busting: Server not ignoring Static Assets Version Timestamp String?

I'm trying to get cache busting working using Andrew's amazing scaffold for Craft CMS. Craft is requesting the timestamped assets but they are not loading. For example, the stylesheet is requested ...
1
vote
1answer
32 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
0answers
60 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
47 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 ...
1
vote
1answer
19 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 ...
1
vote
1answer
32 views

Cache table filling too quickly

Have been using nystudio107 scripts to manage database workflow. Just launched first Craft 3 site and noticed that when i went to sync the database locally from server the /tmp partition on the server ...
2
votes
1answer
64 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
vote
1answer
59 views

Mobile page support

Is there any good practice to how to serve mobile pages differently from Twig? What I would like to achieve is the following, right now we have pages like: http://myawsomecraftpage.com/stories/aaa-...
0
votes
1answer
49 views

How do you clear the templatecachequeries table?

I just noticed that on a site we launched a month ago, the templatecachequeries table is now 500mb. I'm only using the {% cache %} tag in one place on the site, around the main content matrix field. ...
0
votes
0answers
75 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
1answer
66 views

Template cache table growing very big, best way to keep it in line?

So we have built a rather large site for a client, which has multiple regions, locales, user privileges, etc. Some time ago the default cache of Craft couldn't cope anymore with keeping track. The ...
1
vote
2answers
37 views

Caching question

How does the Craft CMS cache work? I want to show a certain message if the server date is between x and y. Can I do this by using an Twig if/else statement or is this cached? My code is like this: {...
1
vote
1answer
12 views

Editing a tag not reflecting on all records.. kindof

We have hundreds of entries with the improperly spelled tag "accessibilty" (the third i is missing). A search for "accessibility" will not find them (spelled correctly). I edited the tag on a record ...
1
vote
1answer
50 views

Using {% cache globally %} inside {% cache %}

I am currently building a website that consist almost entirely of blocks. There are quite a few pages that use the same blocks, but sometimes with slightly different content and not always in the ...
2
votes
1answer
762 views

Clear template cache from the CLI?

I was looking for a way to clear the “template caches” and “compiled templates” from the CLI, as I want to automatically do this after every auto-deploy of the site I've created. For this I was ...
2
votes
1answer
348 views

Craft incredibly slow site performance

I am experiencing incredibly slow site performance. This extends to loading the control panel (/dashboard, /login). This only happens when I put the site on to my hosting, locally using MAMP it runs ...
2
votes
1answer
133 views

Cache not invalidating when using pagination with cache

Any idea why this code wouldn’t update/break the cache when new items are created? Think perhaps the combination of my code for pagination, cache and the ability to also break for pending entries isn'...
2
votes
1answer
165 views

Caching in Craft 3 causes out of memory when including grouped for loop

I have a problem with using {% cache %}in Craft 3, although the code runs fine without caching, and it works in Craft 2. I have narrowed the problem down to the following code: {% cache %} {% set ...
1
vote
1answer
161 views

Craft 3 Redis configuration error

when following the information for enabling Redis in Craft 3, my site just refreshes to a blank screen with a "Internal server error" generic message. Reviewing the server logs reveals: ...
1
vote
0answers
106 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 ...
0
votes
1answer
199 views

Failed to load Twig template “_includes/field”, index “764771142”: cache is corrupted

Making first steps with Craft CMS, and it's great, but there is one thing i can't figure out: When trying to add a new entry with a rather complex set of fields (including matrix) there is an error: ...
0
votes
0answers
13 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 ...
2
votes
1answer
532 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 ...
0
votes
1answer
177 views

Cache and Pagination not working

I'm trying to get pagination and cache to work together but it's failing. Here's my current code: {% cache globally using key craft.request.path ~ '/p' ~ craft.request.getPageNum for 2 hours %}...
0
votes
1answer
120 views

What is the table `templatecachequeries` for?

What is the content of templatecachequeries table for in Craft 3? Especially the column query? And is it normal to have a lot of entries (+5000) even on a smaller medium sized page? Or it is because ...
1
vote
0answers
274 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 ...
0
votes
1answer
183 views

What files does Craft store in “craft/storage/runtime/temp”

What files does Craft store in craft/storage/runtime/temp folder. And what is the purpose of it. And how to stop it form getting huge.
1
vote
2answers
343 views

Bypass Varnish cache if user is logged in

Is it possible to bypass the Varnish cache when the user is logged in? I've tried using the "CraftSessionId" cookie, but it seems that it is also set for non logged in users.
2
votes
1answer
590 views

Caching Issue “unserialize(): Error at offset 0 of 24 bytes”

I have never gotten this before when using Craft cms this is the first. When trying to load my site (locally), I am getting this message unserialize(): Error at offset 0 of 24 bytes I have ...
1
vote
2answers
723 views

Exclude path in NGINX config (for FastCGI Caching)

I've got a Craft 2 site on an NGINX server that uses FastCGI Caching (based on Static Page Caching with Craft CMS), but I've got a few pages that have some dynamic content that I'd like to exclude ...
1
vote
2answers
43 views

Getting Template Errors When Using Cache Tag in some environments but not in others

I'm having an issue where I am getting template errors related to my craft cache tags in some environments but not others. I have my site set up on a production server that is a Linode/Forge setup. ...
0
votes
1answer
484 views

Craft 3: Enabling Memcache

Is there any configuration hint for enabling memcache in Craft 3? I'm on 3-beta-24 I added 'cacheMethod' => 'memcache', to config/general.php, but this did neither cause any hits on memcache nor ...
0
votes
1answer
200 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....
1
vote
1answer
181 views

How to use `{% cache %}` and `{% paginate %}` together?

When using cache tag with pagination should the tag go outside the pagination tag? {% cache %} <div class="grid-x grid-padding-x" data-equalizer data-equalize-on="medium"> {% paginate craft....
3
votes
2answers
513 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
82 views

Security test generated large compiled_templates directory, site outage

We just moved an installation of one of our sites to a new server. Previously, it was on a machine where the versions of Ubuntu / PHP prevented us from upgrading the Craft core version from 2.3.x to 2....
1
vote
1answer
42 views

Craft ordering tags by 'name'

I've got a problem with some tasks. Craft tells me 'Deleting Stale Template Caches Failed' multiple times. When I look in the Deprecated Warnings, it tells me two things: Ordering tags by ‘name’ has ...
2
votes
1answer
240 views

Using Craft with CloudFront, and handling invalidation

I'm trying to get static assets set up to be served by CloudFront. I know how to get the S3 bucket working, and have CloudFront serving from that bucket, but what I can't wrap my head around is how to ...
1
vote
3answers
118 views

Newly added child entries not showing on listing/parent page straight away

I am running into an odd issue where creating new child entries does not bust the cache of the parent page(s) that lists them. This is the structure I am working with: I am displaying the Course ...