Page 1 of 1

Cache control and server settings

Posted: Sat Jul 10, 2021 2:58 pm
by Onimir89
Hello,
thank you for this great work.

I have installed myvesta (default setup) on a debian 10 server.

I have already done the dns setup and I have installed the ssl certficate with cerbot for nginx server.

My website is online and its path is: /home/admin/web/mywebsite.com

The problem is that I can't edit cache-control or other server configurations file.

Which conf file do I have to edit?

I have tried to edit:
/home/admin/conf/ (apache and nginx files)

/etc/apache2/ (all the conf file)

/etc/nginx/nginx.conf and /etc/nginx/conf.d/myip.conf

But I can't enable cache-control and expire.

After the edit i use this commands:
nginx -s reload (If the edit is right I get no error)
curl -I myip.site (I get no cache and expire time in the result, and the Last-Modified is always 4/07/2021)

After Apache edit:
service apache2 restart
curl -I myip.site (same result as above)

Which file do I need to edit to change cache and other settings?

I hope anyone can help me

Re: Cache control and server settings

Posted: Sun Jul 11, 2021 2:19 pm
by myVesta
You can put:

Code: Select all

Header set Cache-Control "max-age=604800, public"
in .htaccess file

Re: Cache control and server settings

Posted: Thu Jul 15, 2021 12:39 pm
by Onimir89
thank you, for your rapid answer.

I'm a noob to this, I have started to study only few weeks ago.

I don't have any .htaccess file in my server after the installation of myvesta.

Any clue about how to solve?

Re: Cache control and server settings

Posted: Thu Jul 15, 2021 2:55 pm
by myVesta
Locate "public_html" folder where you put your site.
There you should create ".htaccess" file.
.htaccess file can have only one line, and that can be:
Header set Cache-Control "max-age=604800, public"

Re: Cache control and server settings

Posted: Thu Jul 15, 2021 3:18 pm
by Onimir89
thank you very much for your help.