Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Cache headers


Go to End


2 Posts   2421 Views

Avatar
Spaghetti

Community Member, 32 Posts

17 May 2013 at 4:07am

I've been advised that caching is not working on my site. I find this odd because I'm explicitly setting the following in my config:

Director::set_environment_type("live");

Shouldn't this enable caching by default?

I've just checked my headers using telnet and found this:

Cache-Control: no-cache, max-age=0, must-revalidate, no-transform

How can I set max-age to something more suitable for my site?

Avatar
Bambii7

Community Member, 254 Posts

17 May 2013 at 12:35pm

It looks like you can set cache age in the config file

HTTP::set_cache_age()

It's a good question and I can't say I've looked into the caching that much. What was the telnet command you used to reveal the cache info?

http://doc.silverstripe.org/framework/en/howto/cache-control

http://api.silverstripe.org/3.0/class-HTTP.html#_set_cache_age