Home › Forums › WordPress Plugins › Hide My WP › Compatibility with Varnish caching
- This topic has 1 reply, 1 voice, and was last updated 8 years, 7 months ago by
jugadelpi.
-
AuthorPosts
-
December 9, 2016 at 7:44 am #13357
Hello,
After implementing Varnish caching in my backend server, HideMyWP is no longer performing rewriting appropriately, therefore, it is no longer replacing urls.
I managed to make it work a little by performing the url replacing manually using the plugin’s replace tools. However, it is still not fully working. Other plugins are able to perform the rewriting present in htaccess file properly, however, this plugin fails to work appropriately when having Varnish enabled. As soon as I disable Varnish caching, the problem disappears.
Is obvious to me that something needs to be excluded in Varnish configuration in order to make this work. Do you have any idea what do I have to exclude in my Varnish side in order to have this plugin fully working?
If not, could you provide me with other workarounds. I have some in mind but I would like to know what do you think and I would require your assistance on them as well:
1- Continue performing manual replacing for all urls using replacing tools. Although is not fully working, if we continue to use it, we might resolve the problem completely. However, as you might guess, this is not an easy workaround since I would basically have to do everything the plugin does manually using the plugin’s replace tools.
However, I was thinking you could provide me with a working config where you had to do everything manually using replace tools. Or if you could provide me with any assistance you consider appropiately here.
2- I have my backend server in the following way:
Nginx (Only used as reverse proxy and SSL Decryption) ==> Varnish (Performing all caching of static and pages) ==> Apache (Some requests are passed to Apache since they cause problems if they are cached)
Basically: Nginx ==> Varnish ==> Apache
Since, I am using Nginx, I am wondering if I could make the plugin work by configuring it as if I were using Nginx in the server as the web service. However, the only problem is that I am using Nginx only as reverse proxy passing all requests to Varnish and then Apache, therefore, I don’t know if this approach would work as expected.
3- The third workaround is if you could provide me with the necessary information on what I need to exclude on my Varnish config in order to make this work.
This should be the preferable solution. If you do not know how to make this, if you could provide me with the type of requests that your plugin is using to perform the rewriting and I can try to exclude it from Varnish.
I know this problem will be very hard to resolve. Therefore, please take the necessary time that you need in order to perform the necessary investigation or anything you need.
Please let me know if you need the current Varnish config I am using in my backend server.
Best regards,
GabrielDecember 9, 2016 at 8:41 am #13361Hello,
At the end, I finally resolved it. I think without noticing I have increased my website troubleshooting skills lol.
After trying using the Light Privacy plugin option (Most compatible), the problem disappeared. However, of course I could not use that option in my production website, therefore, I had to see the differences between the compatibility modes in order to find what option was exactly causing the problem.
I discover that the following option was causing the problem under Source Code setting on the HideMyWP plugin:
Remove version number (?ver=) from styles and scripts URLs.
I found a Varnish config stating if the (?ver=) was present, there could be problems with Varnish.
However, that option from your plugin should, apparently, indeed be removing the (?ver=), therefore, there should not be any problems in theory even if the option is present.
At the end, it was not a Varnish issue after all. Issue resolved.
Best regards,
Gabriel -
AuthorPosts
You must be logged in to reply to this topic.