MODX Revolution
Windows 7
I've got this:
HTTP/1.1 200 OK
Server: nginx/1.2.1
Date: Wed, 15 Mar 2017 14:22:26 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/5.4.45-0+deb7u7
Set-Cookie: PHPSESSID=ha1of3qb403phm23uprm09hmo6; expires=Wed, 22-Mar-2017 14:22:26 GMT; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: max-age=300
Pragma: no-cache
And I need:
Cache-Control: max-age=7days
Also Google PageSpeed telling me to Leverage browser caching for:
jpg\png\css\js
I tried:
to add modules to htaccess, but it's not working (maybe modules aren't avaliable, maybe nginx taking over control i don't know)
I believe the right answer is something like this:
# Expire rules for static content
# cache.appcache, your document html and data
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
# access_log logs/static.log; # I don't usually include a static log
}
# Feed
location ~* \.(?:rss|atom)$ {
expires 1h;
add_header Cache-Control "public";
}
# Media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# CSS and Javascript
location ~* \.(?:css|js)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
But i don't understand where i have to place this code. They say: "place it in the block
server of your site"
Maybe someone knows where is exactly this file with this block?
Or there's easier way?
Please, can you help me to fix it, i'm fighting 24hours already.
[ed. note: sotandr last edited this post 9 years, 7 months ago.]