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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

1
vote
1answer
21 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 ...
0
votes
0answers
19 views

Craft 3 index template cached, cannot update.

So just added craft 3 on a server. I have a layout template for my head, footer etc., index template set as homepage, and a 404 page. No matter what I do, the index template will not update. The file ...
2
votes
1answer
67 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
20 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
42 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
32 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
27 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
56 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
98 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
8 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
138 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
76 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
46 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
155 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
53 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
0answers
16 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 ...
0
votes
0answers
127 views

Cannot resolve “Deleting stale template caches” getting stalled

I'm out of ideas here. I have made a website for a client which has a lot of entries with each having a lot of fields (including a lot of matrix and neo fields). And the "Deleting stale template ...
0
votes
0answers
120 views

Template cache not clearing when a new entry is added

I have a custom element when I add a new entry to it the template cache doesn't clear and doesn't display the newly added entry But when I edit an existing one it does clear the cache and displays ...
1
vote
2answers
152 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
240 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
479 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
46 views

Issue on setting up Memcache in AWS

I have Craft CMS 2.6.2989. I launched a separate EC2 for memcache server in AWS. However, I got "Internal Server Error", did I miss any configuration? Thanks MemcachePool::set(): Server localhost (...
0
votes
0answers
48 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
35 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
325 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
151 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
139 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
1answer
374 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
62 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
37 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
116 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
79 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
132 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
47 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
56 views
5
votes
1answer
171 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
61 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
124 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
60 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
339 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|...
0
votes
0answers
34 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 %}...
1
vote
0answers
189 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: ...
3
votes
1answer
107 views

'cacheDuration' => false, sets cache file expiration date to 1 year

So I noticed that by setting the 'cacheDuration' => false it seems to set, by default, the expiration date to 1 year from when the cache is saved. I found this in /app/services/...
1
vote
1answer
418 views

Caching and TTFB with Craft

I've just launched my new site here and I'm playing around with the caching options with Craft. I'm hosting my site with Siteground which gives me access to their Supercacher option, it offers Static ...
0
votes
1answer
46 views

How to update cart.lineItems while specifying HTTP cache headers?

I use the following cache system, specified in the header of all pages: {% set expiry = now|date_modify('+1 day') %} {% header "Cache-Control: max-age=" ~ expiry.timestamp %} {% header "Pragma: cache"...
0
votes
1answer
60 views

Data cached in plugin controller via CacheService won't expire

My cache won't expire. This is effectively my code: $template = (isset($params['template']) ? $params['template'].'?'.$config['pageParam'].'='.$pageParam : null); if(craft()->cache->...
1
vote
1answer
41 views

Invalidate cache from two channel expiry dates

I have two channels: A event and a news channel which I want the cache to expire based on both their expiry Date. {% set newsDate = craft.entries.section('newsDate').order('expiryDate asc').first() %}...
2
votes
2answers
255 views

Event Listener for Publishing Scheduled Posts

For performance reasons I'm caching full HTML responses to Redis. This does wonders for response times, but cache invalidation becomes a bit tricky... I'm currently purging the entire cache on '...
3
votes
3answers
1k views

Force browser to download latest CSS file

Is there any simple way to automatically add a version number when referencing a CSS file? Example: <link href="style.css?v=VERSION-HERE" rel="stylesheet" type="text/css"> Version could be a ...
3
votes
1answer
57 views

Caching ElementCriteria Lookups In Craft CMS Plugins

Two recent sites I’ve built have plugins built to handle filtering through projects based on some categories and related entries. For example the lookups look similar to this: # Get element criterea ...