Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Pragma: no-cache

Started by Bent Terp 8 years ago · 2 replies · 1418 views
8 years ago

Hi,
I'm trying to deploy CloudFront in front of Grav but not getting any CDN benefits, only cache misses.

I think it's because Grav inserts a "Pragma: no-cache" into all rendered pages and CloudFront accepts this as "oh, best not cache then"

Is this the reason?
How do I get around it?

with kind regards,
Bent

8 years ago

Interesting. I just checked my sites, and all my Grav sites have the same header, but my non-Grav sites on the same host don't. But if you look at the source code, the only time the Pragma header is set is in the Grav\Common\Utils::download function.

👍 1
8 years ago

Ended up "solving" the problem by hardcoding a minimum TTL of 3600 sec into the CDN for URLs outside /admin namespace and having TTL=0 for /admin

The CDN will then cache the content even if it has Pragma: no-cache.

But if somebody has a better solution, I would appreciate to hear about it 🤔

This seems related to /forum/installation-hosting/how-to-set-cache-control-for-images-t4016

last edited 08/27/18 by Bent Terp

Suggested topics

Topic Participants Replies Views Activity
Support · by TomW, 1 day ago
1 37 18 hours ago
Support · by TomW, 1 day ago
0 45 1 day ago
Support · by TomW, 5 days ago
6 131 2 days ago
Support · by Anna, 2 weeks ago
2 164 5 days ago
Support · by Anna, 4 weeks ago
1 333 4 weeks ago