Stack Exchange Network

Stack Exchange network consists of 174 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 [cache]

The tag has no usage guidance.

0
votes
0answers
17 views

Unable to write in the cache directory

Folks: I've moved a test site (running the latest version of Craft 2) from a server with PHP 5.x to a server with PHP 7.x. I figured it would be a quick upload and database hookup but I'm getting the ...
1
vote
0answers
39 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
20 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
16 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
23 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 ...
1
vote
1answer
26 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
21 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
22 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
14 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
37 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
30 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
29 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 ...
1
vote
1answer
230 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
96 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
46 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
83 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
84 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
50 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
0answers
104 views

Craft 3 Cache To HTML

So the site I am dealing with is heavy load, lots of records and looping through a matrix records on top of it all. Everything about it, is slow, just because, not a Craft thing but a data thing. I ...
0
votes
1answer
137 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
11 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
269 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
109 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
76 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
211 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
0answers
79 views

Cloudfront full site delivery help

I'm attempting to serve our craft cms site fully via cloudfront. I understand the concept of the caching behaviors, but am struggling to get logged into the admin. My first behavior (rule) cloudfront ...
0
votes
1answer
119 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.
0
votes
0answers
18 views

Does the cache “for” parameter delete old caches?

As the questions asks. I'm using the coldcache plugin instead of the normal cache and I've set the for parameter to 5 secs. for 5 secs But when I reload after 5 secs, a new cache is generated with a ...
1
vote
2answers
213 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.
1
vote
1answer
364 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
576 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 ...
0
votes
0answers
53 views

Globals variable caching

I am updating a globals variable and am not seeing it update my page. I went into settings and cleared caches, but I'm still not seeing the variable update. If I make the same change in my dev/test ...
1
vote
2answers
39 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
382 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
166 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
155 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
447 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
68 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
39 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 ...
1
vote
1answer
172 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
97 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 ...
3
votes
2answers
169 views

How to Cache Globally Except for One Page

I have a template element that is used on almost every page of the site. I would like to cache that element globally, except on one particular page I would like it to just be a normal cache based on ...
1
vote
1answer
51 views

Using cache tag on array outputs nothing

Okay. I've figured it out but it left me with the question. After some page refreshes It's got stack back at empty output again. Bad: {% cache %} {% for item in orders %} {# Following variable ...
4
votes
1answer
62 views
6
votes
1answer
201 views

How to omit certain tag from (% cache %)

How can I omit a certain tag from being cached? I have a large page with a fair few queries but halfway down I am loading in a Freeform Form field which cannot be cached. But I'd like all of the ...
2
votes
1answer
65 views

How can I make Craft's caching aware of fields used inside a plugin?

I have a complex template which uses various modules and sub-components for which I opted for handling all the logic and rendering directly in PHP, as it felt like it was too complex a job for twig. ...
3
votes
1answer
150 views

What's the difference between setting cache with {% header %} tag and {% cache %} tag?

I've came to a cache problem/question on one of my sites when I run a speed test and I failed caching test. I have very little knowledge in this area and I'd like to enhance it. Documentation for {% ...
2
votes
1answer
61 views

Update content inside cache tag

Hello I am building a system in craft cms using the getharvest api. I have 'translated' the php api to support twig. The problem is the getharvest api is really slow (10+ seconds loading time) I have ...
1
vote
0answers
414 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|...