New cache time feature - a trap

I just discovered a gotcha with the new Type Code Cache Management cache expiry.


You can set the cache expiry headers to be different from the cache time in matrix, causing the user (or squid) to come back more frequently.



This is useful if you expire the cache via a trigger or some other means.



If you have the home page asset for the site pointed at a standard page, and the standard page set to expire in (say) 300 seconds it does not send those headers when you hit the root of the site - that is "/".



You need to set the Site asset to have the cache time you want for the home page, as this is the asset that gets hit when you got to "/"



cheers,



Richard

There is also a not so well known workaround for asset types that you never want cached, (like custom forms, for instance).


If you set "Cache status: [ Disabled ]" for an asset type, Matrix itself will not cache the file. However, the cache headers will still instruct upstream proxies, (and browsers), to cache the page, (assuming you have these enabled of course).



Setting the header cache time, (the exact label escapes me), to a value of 1, will give you an effective equivalent of "no-cache". If you set the value to zero, it will inherit the default value. I haven't tried setting it to a negative value.

[quote]There is also a not so well known workaround for asset types that you never want cached, (like custom forms, for instance).


If you set "Cache status: [ Disabled ]" for an asset type, Matrix itself will not cache the file. However, the cache headers will still instruct upstream proxies, (and browsers), to cache the page, (assuming you have these enabled of course).



Setting the header cache time, (the exact label escapes me), to a value of 1, will give you an effective equivalent of "no-cache". If you set the value to zero, it will inherit the default value. I haven't tried setting it to a negative value.[/quote]

Hello 'Colin Macdonald' - Newbie. Good tip. :wink:


I am nublet :)

This becomes even more important when implementing ecommerce or other cache-sensitive pages.