Symptoms
-
Cache expiration is enabled in Nginx in Plesk according to the article with expiration time set explicitly, but cache expiration headers are not returned:
# wget -S https://example.com/wp-content/uploads/file.jpg 2>&1 | egrep “Server|Content-Type|Cache-Control|Expires”
Server: nginx
Content-Type: image/jpeg -
Website is a WordPress instance.
-
In Domains > example.com > PHP Settings for a domain PHP handler is set as FPM application served by nginx.
Cause
This is Plesk internal issue with ID #PPPM-4413, which is planned to be fixed in future Plesk updates.
Resolution
As a workaround, apply the following solution:
-
Change PHP handler to FPM application served by Apache in Domains > example.com > PHP Settings.
-
Check if Leveraging Browser Caching for nginx is enabled, for example:
# wget -S https://example.com/wp-content/uploads/file.jpg 2>&1 | egrep “Server|Content-Type|Cache-Control|Expires”
Server: nginx
Content-Type: image/jpeg
Expires: Thu, 05 Oct 2017 20:36:13 GMT
Cache-Control: max-age=604800# curl -I -c – “https://example.com/wp-content/uploads/file.jpg” -k
…
Expires: Thu, 05 Oct 2017 20:53:53 GMT
Cache-Control: max-age=604800
…
Â