Cache control and server settings

Post Reply
Onimir89
Posts: 3
Joined: Wed Jul 07, 2021 12:10 pm

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

Tags:
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

You can put:

Code: Select all

Header set Cache-Control "max-age=604800, public"
in .htaccess file
Onimir89
Posts: 3
Joined: Wed Jul 07, 2021 12:10 pm

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?
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

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"
Onimir89
Posts: 3
Joined: Wed Jul 07, 2021 12:10 pm

thank you very much for your help.
Post Reply