Custom Expiry Headers
Setting Custom Expiry Headers using .htaccess
When using Origin Pull, you get a default TTL (Expiry Date for the cached files) of 24 hours, you get also the option to override that, or set it if not already set on the server. But how do you set a custom expiry header on your server, for a certain file type, using Apache .htaccess (or httpd.conf for advanced users with administrative access to their hosting servers). Setting a default TTL/Expiry Header in .htaccess: This is fairly easy, you can set an expiry header to a certain file, or a certain file type, or multiple file types to any length desired, and the CDN will honor this header. If you wish to make the TTL of 12 hours for example, that would be 60*60*12 = 43200 seconds. Example: ExpiresActive On|
1 2 3 |
ExpiresDefault A43200 Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0" Header set Pragma "no-cache" |
|
1 2 |
<filesmatch "\.(js)$"=""> ExpiresDefault A43200 |
|
1 |
ExpiresDefault A43200 |
|
1 |
ExpiresDefault A43200 |
|
1 2 3 |
ExpiresDefault A0 Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0" Header set Pragma "no-cache" |
|
1 2 3 4 |
<filesmatch "\.(js)$"=""> ExpiresDefault A0 Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0" Header set Pragma "no-cache" |