How to add cache control in the nginx-apache webserver
Posted: Sat Apr 14, 2018 5:14 pm
Hi there,
I am using a CDN which requires me to set a Max Age and "public" in the origin server which currently uses vestacp (Nginx+apache).
I tried settings this in the .htaccess:
That does not work though. The header still says "cache-control: max-age=315360000"
Not sure where this 315360000 comes from. I assume vestaCP has it set somewhere in nginx or apache..
I tried searching in the vestaCP advanced server configuration for that number and 'cache control' as well. But couldnt find anything that sets that number.
Any tips on how to get this sorted? Maybe override it in some way by htaccess?
Thanks!
I am using a CDN which requires me to set a Max Age and "public" in the origin server which currently uses vestacp (Nginx+apache).
I tried settings this in the .htaccess:
Code: Select all
# One month for most static assets
<FilesMatch ".(css|jpg|jpeg|png|gif|js|ico)$">
Header set Cache-Control "max-age=2628000, public"
</FilesMatch>
Not sure where this 315360000 comes from. I assume vestaCP has it set somewhere in nginx or apache..
I tried searching in the vestaCP advanced server configuration for that number and 'cache control' as well. But couldnt find anything that sets that number.
Any tips on how to get this sorted? Maybe override it in some way by htaccess?
Thanks!