echidna
echidna copied to clipboard
Caching headers for dated specifications
The caching headers for the dated specs are currently set for 1 year:
denis@krave ~% curl -I http://www.w3.org/TR/2015/WD-SRI-20150505/
Last-Modified: Tue, 05 May 2015 14:26:33 GMT
Cache-Control: max-age=31536000
Expires: Fri, 06 May 2016 05:22:10 GMT
Now people can publish multiple times a day, these headers should be set only if the date is over
@deniak, I am not so sure we should do this as it might complexify our apache config, but nevertheless that seem possible using Expressions in Apache:
# Disable caching if document was published today
# (to enable publication of new revisions on teh same day)
<If "%{REQUEST_URI} =~ ^/TR/%{TIME_YEAR}/.+-{%TIME_YEAR}{%TIME_MONTH}{%TIME_DAY}/">
ExpiresActive Off
</If>
Or if we don't want to fully disable caching for those URIs it could be set to a shorter value (eg 1hour).
ExpiresDefault "access plus 1 hour"