Questions tagged [cache]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
5
votes
1answer
15k views

Adding cache headers to Nginx configuation file breaks the /admin area

When I add this to my Nginx Confirguration file: location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 7d; add_header Pragma "public"; add_header Cache-Control "public, must-revalidate, ...
1
vote
1answer
203 views

Does the cache tag behave differently for Mobile vs Tablet vs Desktop?

Are different cache saved for Mobile / Tablet / localisations or do we have to take care of this? I.e. if i use: {% if craft.request.isMobileBrowser() %} will the response be cached for desktop ...
4
votes
1answer
523 views

How can I time-profile the page load for a Craft request?

I would like to see how long plugins take to load, as well as other aspects of the page (loops and database requests). My webpage can take ~2-3 seconds to return the initial request. It seems high ...
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 ...
6
votes
1answer
2k views

Varnish 4.x and Craft

Is there any vcl file to use with Craft? I saw here an amazing answer about Varnish and Craft and there is a 3.x configuration file but i need a newer one for Varnish 4 and i don’t know Varnish ...
9
votes
2answers
6k views

Is it possible to clear caches and re-index assets programattically?

When migrating a Craft site, I'm used to... deploying files checking my config, tweaking as necessary loading a database backup running "Update Asset Indexes" and "Clear Caches" from the control ...
1
vote
1answer
510 views

Configure Memcache per environment

Is there any way to add memcache servers to use per environment? I mean, one server for dev, one for staging and one for production.
1
vote
1answer
195 views

Craft URLs intermittently being cached as /index.php/my-page/ or /index.php?p=my-page

Cross-posting from here, as I'm not sure if this is a Craft issue or specific to the cache-clear plugin. Intermittently (twice in a day now), I've seen templates being cached with Craft URLs ...
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?
9
votes
1answer
962 views

Is there a way to override the template caching system?

We're in the process of building a restfull backend in craft. We had sluggish response times due to the amount of queries done by craft on a an entry listing. Each entry had about 3 levels of nesting ...
3
votes
1answer
150 views

On a Archive: how could I break cache for the current year, but not the others?

I have an archive of an event based site. I know how to break cache until the next event. No Problem {% cache until nextEvent %} But the archive works the following way: archive -- 2014 (latest ...
25
votes
1answer
4k views

Generating pending image transforms stuck in process

In the CMS the progress indicator for tasks is stuck and not completing its jobs. What can I do to resolve this?
3
votes
1answer
173 views

Does it make sense to cache a Global?

I have a global that consists of 1 rich text field and the content is displayed on every page. Does it make sense to cache that? If so, I am assuming it should be cached globally?
2
votes
2answers
349 views

How to cache content per user?

Is there a way to cache content with the (% cache %} tag on a per-user base? If user A is logged in, his content gets cached. User B logs in, but his content should not interfere with that of User A.
4
votes
1answer
270 views

Cached entries and postDate / expirationDate [duplicate]

How does the {% cache %} tag handle a situation where an entry reaches its post date or expires?
3
votes
1answer
2k views

Long 'Deleting stale template caches'

Is it common to have a (near)constantly running 'Deleting stale template caches' task ongoing? I commonly log in to see a task still pending several hours after the last change to the site was made, ...
3
votes
2answers
365 views

Template caching tag storage options

I can see that normal caching can have it's storage specified, but I would specifically like to be able to set the caching storage method for the template tag {% cache %}. At the moment it appears to ...
2
votes
1answer
265 views

How to clear a third-party cache when Craft updates its own template caches

We're experimenting with using Fastly for full-site caching of a Craft site. Everything is working great so far, with the exception that Fastly obviously has no way to know when a URL's cache has been ...
9
votes
1answer
419 views

Caching not working on page with asynchronously loaded asset transforms

I'm using PictureFill on a large page, containing many image transforms, that doesn't seem to be caching despite most of the page being wrapped in {% cache %} tags. When I view the page after several ...
2
votes
2answers
533 views

What configuration does Craft need to enable Live View on hoster CloudFlare with SSL/https CP?

In a previous question and answer, I've laid out recent experience in bringing up Craft on the combination of CloudFlare and Railgun offered as a free feature for VPS hosting at Arcustech. The ...
5
votes
2answers
674 views

Can Craft handle thousands of entries and high traffic?

We are going to start an online magazine. Registered users will be able to submit new entries (articles, places, etc...). Can Craft handle thousands of entries and high traffic (Of course with ...
6
votes
2answers
442 views

Cache tag won’t cache in a template

The image tag shown below prevents my {% cache %} tag from caching the loop it's in. If I remove the image tag or change the data-resource attribut to a normal src, it works fine. The class="lazy" and ...
4
votes
1answer
1k views

Cached template content not invalidating

My understanding of the {% cache %} tag is that if the content between it changes, the cache is invalidated and you see the new content. I'm having an issue where a new entry is created in section, ...
2
votes
2answers
2k views

CDbCommand failed to execute

This may not be Craft related of course but I’m getting the following error: Internal Server Error CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1205 Lock wait ...
11
votes
4answers
5k views

Can I disable template caching for local development?

Can I disable template caching for local development? For example: setting a environmentVariable in a config file? Or is this possible in the future?
6
votes
1answer
1k views

What's the best way to clear cached JSON responses from a third-party API?

I'm building a plugin to browse store orders via a third-party API. I make various requests to URLs that can include query parameters: /customers /orders/e8b48e72-9c7f-4d6f-91aa-2f7238bdf936 /orders?...
18
votes
4answers
2k views

Cache invalidation to automatically update all cached template content?

I am using the cache tag in my templates. How can I assure that a site visitor always gets the data directly from the cache and never has to wait for it to be generated? My cache gets invalidated ...
6
votes
3answers
646 views

Is it possible to use environment variables as the cache duration?

I'm trying to set a cache duration as an environment variable. I set up various environment variables and know they are being referenced correctly in my templates because I can print out the values ...
9
votes
2answers
485 views

Why does my base template never reload?

I use template inheritance: In _layout.html every other template is loaded with {% block content %}{% endblock %} The problem: _layout.html never reloads. I changed the CSS path in the head tag of ...
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 ...
40
votes
2answers
4k views

What are the best practices for using the {% cache %} tag?

I started using the {% cache %} tag and would like to know what the best practices are: . Regarding performance: For example does it make sense.. ..to cache the whole template, or is it better to ...

1 2 3 4
5