• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Resolved Leverage browser caching

dyrer

Basic Pleskian
hello i have the the code bellow in Serve static files directly by nginx directives
PHP:
gzip  on;
gzip_http_version 1.0;
gzip_comp_level 9;
gzip_min_length 1100;
gzip_buffers     4 8k;
gzip_proxied any;
gzip_types
# text/html is always compressed by HttpGzipModule
text/css
text/javascript
text/xml
text/plain
text/x-component
application/javascript
application/json
application/xml
application/rss+xml
font/truetype
font/opentype
application/vnd.ms-fontobject
image/svg+xml;

gzip_static on;

gzip_proxied        expired no-cache no-store private auth;
gzip_disable        "MSIE [1-6]\.";
gzip_vary           on;

location ~* \.(txt|xml|js)$ {
    expires 8d;
}

location ~* \.(css)$ {
    expires 8d;
}

location ~* \.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg)$ {
    expires 8d;
}

location ~* \.(jpg|jpeg|png|gif|swf|webp)$ {
    expires 8d;
}

but still GTMetrix result shows expiration not specified for gif, png etc


How can fix that?
Thanks in advance
 
Hello @dyrer ,
it's not required to enable the settings "serve static files directly with Nginx" to apply addtional directives :

GTmetrix require to allow browser cache for at least 30 days to validate this rule.

Here the configuration used on my servers :
Code:
# Enable Gzip compression
gzip on;
gzip_disable "msie6";
 gzip_vary on;
 gzip_proxied any;
 gzip_comp_level 6;
 gzip_buffers 16 8k;
 gzip_http_version 1.1;
 gzip_types
 application/atom+xml
 application/javascript
 application/json
 application/rss+xml
 application/vnd.ms-fontobject
 application/x-font-ttf
 application/x-web-app-manifest+json
 application/xhtml+xml
 application/xml
 font/opentype
 image/svg+xml
 image/x-icon
 text/css
 text/plain
 text/x-component
 text/xml
 text/javascript;

# Cache static files
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp)$ {
  add_header "Access-Control-Allow-Origin" "*";
  access_log off;
  log_not_found off;
  expires 30d;
}
|/code}
 
Back
Top