Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Pragma: no-cache

Started by Bent Terp 8 years ago · 2 replies · 981 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 Thomas, 1 week ago
2 54 12 hours ago
Support · by Anna, 3 days ago
2 60 15 hours ago
Support · by Justin Young, 15 hours ago
1 30 15 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 57 5 days ago