Applicable to:
- Plesk for Linux
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
...
Comments
23 comments
What is the exact change because the current configuration is for a domain PHP handler is set as "FPM application served by Apache". And also the workaround states the same thing:
Change PHP handler to "FPM application served by Apache" in Domains > example.com > Hosting settings .
Hi @gli Pançi, do you mean that handler is set to "FPM application served by Apache" and cache expiration is enabled in nginx but cache expiration headers are not returned by server?
I have FPM application served by Apache and nginx in proxy mode.
Despite the change I never see the cache-control header.
Hi @David,
If expire headers are not working with Apache, another reason might be involved. Please submit request to a support in order to investigate it thoroughly: https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-
Hi,
I found the fix that worked:
https://support.plesk.com/hc/en-us/articles/360014674853-Additional-nginx-directives-Leverage-browser-caching-are-ignored-for-a-WordPress-website
Thank you
Hi @Matthias,
Thank you for the provided way!
I added a link to this article in the "Additional information" section in order to help others, who have the applied Hotlink protection security measure in WordPress as you, to resolve the issue
Looks like it works fine once "Hotlink protection" is disabled. Spent about 1 hour trying to fix it on a new domain - didn't suspect Plesk initated update. Just in case, I got 3.6.1-1603 of WP Toolkit and Version 17.8.11 Update #40 of Plesk.
Hi @Mikhail Krivoshein,
You hit another bug here that is documented on the following link: https://support.plesk.com/hc/en-us/articles/360014674853-Additional-nginx-directives-Leverage-browser-caching-are-ignored-for-WordPress-website
its still not entirely fixed though, but will be fixed soon!
Hey guys,
Not sure if the fix has been released yet,
I've got fresh version of Plesk, fully updated, and expiry headers are not being applied, not only in WordPress, but in any site, including static HTML.
If you could give me an update.
Thanks
Hello @Rafal,
Indeed, it is not fixed yet. It is planned to be fixed in the next major Plesk release.
For now, please, use the workaround specified in this article.
I'm afraid this isn't possible, entire Hosting environment is configured for NGINX.
Any ETA on the next Plesk release?
@Rafal,
Right now there is no precise ETA for the release.
After the fix will be ready this article will be updated with the corresponding information.
Additionally, the description of releases and fixed issues may be found here: https://docs.plesk.com/release-notes/onyx/change-log/
Seriously, when is this going to be fixed? Serving the site from Apache behind nginx is not an option as we have quite a number of production sites being served directly by nginx that have been heavily optimised and tested using pagespeed. The work involved in reconfiguring and re-testing them to run Apache behind nginx is unthinkable.
Hello Tim, we don't have ETA at this moment.
Anton Maslov Ivan Postnikov we desperately need this bug fixed, as it has a detrimental impact on the website performance scores. This bug has been going on for nearly 1 year now, why does it take so long to fix it for us using nginx?
There are workarounds by using Apache as well as alternative Wordpress plugins/solutions to use cache, thus priority for this bug is low. We don't expect this bug to be fixed in nearest time.
............. No words !
We need a solution for this.
Any ETA on the next Plesk release with a solution for this?
PHP handler is FPM application served by Apache
But still expire settings are ignored! Even when set in apache config or .htaccess
We run NGINX as proxy. Also the link "Additional nginx directives/Leverage browser caching are ignored for WordPress website" is not pointing to any article!
Hello, @Sysadmin
If after applying the workaround the issue remains - please submit a ticket to us: https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-
The link to non-existing article was removed, thank you for pointing our attention to that!
Hello, @Emilio
Currently we have no ETA for fixing this issue. Please use the workaround described in the article.
Hello, the fix is not working. Moreover, it is impossible to send you a message via the support because I have a license from OVH in France. How to do ? Thank you
@Mickael Kerenterff
All support options are described here:
https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support-
Shortly, if a license was bought from OVH, OVH should provide support for Plesk. Please contact them for assistance. If needed, they will contact us directly on your behalf.
If they cannot assist you or you would like to receive support from Plesk directly with OVH license, consider subscribing to the Support Subscription:
https://support.plesk.com/hc/en-us/articles/213953025
Please sign in to leave a comment.