We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
How to add cache control in the nginx-apache webserver
How to add cache control in the nginx-apache webserver
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!
Re: How to add cache control in the nginx-apache webserver
This is really frustrating. Something within Vesta is overwriting the htaccess settings.
I didn't change anything after installing vestaCP. So either the basic nginx does this or apache.
Still couldn't find out what it is >:(
I didn't change anything after installing vestaCP. So either the basic nginx does this or apache.
Still couldn't find out what it is >:(
Re: How to add cache control in the nginx-apache webserver
It seems Apache or nginx does this automatically on VestaCP. Can someone confirm? and where to change that setting? Because it ignores htaccess for this matter on vesta standard.
Re: How to add cache control in the nginx-apache webserver
The default setting in Vesta NGINX to expire: max - http://nginx.org/en/docs/http/ngx_http_ ... ml#expires
315360000 = 10 years per the documentation
You can override this in your panel config. Under Vesta - WEB configuration, look at the nginx proxy section. Remove all extension you do not want this in the Proxy Extensions section.
315360000 = 10 years per the documentation
You can override this in your panel config. Under Vesta - WEB configuration, look at the nginx proxy section. Remove all extension you do not want this in the Proxy Extensions section.
Re: How to add cache control in the nginx-apache webserver
This is frustrating....qwerz wrote: ↑Tue Apr 17, 2018 6:31 pmThis is really frustrating. gmail sign up Something within Vesta is overwriting the htaccess settings.
I didn't change anything after installing vestaCP. So either the basic nginx does this or apache.
Still couldn't find out what it is >:(