Answer the question
In order to leave comments, you need to log in
How to set up pagespeed mod on ngnix to work stably?
Hello.
I will check through https://developers.google.com/speed/pagespeed/insights/
When checking, there are always different readings, then it says turn on the browser cache, then optimize the pictures. Sometimes everything looks good.
The config says:
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
Answer the question
In order to leave comments, you need to log in
You need to increase the cache lifetime.
Add the following:
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
location ~ "\.pagespeed\.([az]\.)?[az]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
This will increase the cache lifetime to one day, increase the cache size to 400mb.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question