-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache get bypassed when using dynamic cookies #204
Comments
This can be achieved by adding custom Nginx code in the "start" configuration file (https://github.com/SatelliteWP/rocket-nginx#before-rocket-nginx-starts). You might want to modify the We've done this in the past for a client. We would have to know the specific rules to code it for you. Unfortunately, this is "out of scope" for Rocket-Nginx. Feel free to contact SatelliteWP for custom work if you have a budget for your project: |
Well, in fact I can code it by myself. I was pointing it here because I was hoping a solution in next release, the same that you can add query args to bypass using the INI file. |
It seems to me that the problem you are facing is specific to a plugin that use the same URL to display different content. Yes, query args are supported. I also added support for dynamic file ending exactly for the case you are referring to! Feel free to share your solution to the community. |
That's what I was talking about. When there is a plugin that changes the HTML based on a cookie value it can be configured in WP Rocket to create separate caches. This can be solved also manually into the generated conf file by rocket-nginx. But however, the php rocket-parser doesn't use any parameter from the INI file, so it can't be solved that way. This can be done with query params, for example, to do the opposite; to use the same cache file ignoring the query param. So it could be very useful if next rocket-nginx release adds INI support for dynamic cookies also. kind regards and keep up the wood work :) |
I do not understand what you mean here. The generated
Yes. To do something similar with Rocket-Nginx, create a "start" file in the configuration folder for your website, get the cookie value using Nginx's |
So that's the problem. Because there is not any parameter into |
Is there a reason why you did not edit the variable to set the proper value you want in I'm not sure I understand the issue. |
In WP Rocket you can setup the use of dynamic cookies to serve from a different cache with a plugin or custom code (in functions.php). For example a cookie where the language code is stored. The procedure works very well and the files are beign created into the cache folder using the cookie value appended to the filename as expected. But the rocket-nginx ignores this and always returns BYPASS into the X-Rocket-Nginx-Serving-Static header. How can I setup rocket-nginx to use this special cookie values?
More info about this feature here: https://docs.wp-rocket.me/article/1313-create-different-cache-files-with-dynamic-and-mandatory-cookies
Thanks in advance,
The text was updated successfully, but these errors were encountered: