Comments (7)
Our README for WordPress preset states clearly:
VARNISH_WP_PRESERVED_COOKIES:
Not affected by$VARNISH_KEEP_ALL_COOKIES
and
Cookies (
$VARNISH_STRIP_COOKIES
) stripped unless$VARNISH_KEEP_ALL_COOKIES
is set
and
VARNISH_STRIP_COOKIES
Ignored if$VARNISH_KEEP_ALL_COOKIES
is set
Also, the search by $VARNISH_KEEP_ALL_COOKIES
in the repository will show you that it clearly has nothing to do with WordPress preset:
varnish/templates/defaults/vcl_recv.vcl.tmpl
Lines 29 to 42 in 948d487
from varnish.
Some more info
varnish implementation: varnish:4.1-4.1.2.
Wodby infrastructure version: 5.5.3
Wordpress stack version: wordpress-php:7.2-4.11.0
from varnish.
Chingis we saw this stuff and it appears that you guys decided to remove from PHP all cookies except the ones that are preserved in Varnish.
Even dough we set the varnish keep all cookies the cookies are not in PHP except the varnish preserved ones but than the page is not cached which is not an ideal approach. What if like in our case u need a cookie to be reached in PHP but not to affect on the cache, we were unable to configure that with the available configs.
Is it possible at all to achive that now with the provided params and avoid huge costs?
from varnish.
@csandanov what about this part here
varnish/templates/presets/wordpress.vcl.tmpl
Lines 17 to 49 in 8a4e91d
If there is a cookie here and it's not in the preserved ones it would be stripped and then missing in PHP. Here the VARNISH_KEEP_ALL_COOKIES is not even mentioned....
from varnish.
If it does not find the cookies from the preserved it would unset them and they would not be in PHP, sounds like a bug to me.
What makes you think it's a bug? WordPress preset description states:
If a cookie from
$VARNISH_WP_PRESERVED_COOKIES
is set a page will not be cached. All other cookies stripped
VARNISH_WP_PRESERVED_COOKIES:
Not affected by
$VARNISH_KEEP_ALL_COOKIES
Also see https://varnish-cache.org/docs/3.0/tutorial/cookies.html:
Also, if the client sends a Cookie header, Varnish will bypass the cache and go directly to the backend.
from varnish.
@csandanov obviously you don’t have a full coverage of cases and that’s why you are asking why do we consider this a bug, if you change something that has a negative impact without a backwards compatibility than it must be a buggy approach (clean coding principle) -the way it was before it worked for us perfectly. If a cookie in VARNISH_WP_PRESERVED_COOKIES is set the page would not be cache and all others would be stripped, what is the purpose of VARNISH_KEEP_ALL_COOKIES than? Beside that how do we affect now on the negative rule changes since you don’t have a roll back to the previous stack. It would be much easier if this config would be working VARNISHD_VCL_SCRIPT but it’s not, why not (you told us to use the configs but this one does not work on the prod server)?
from varnish.
if you change something that has a negative impact without a backwards compatibility than it must be a buggy approach -the way it was before it worked for us perfectly.
it's not an argument, we've made many changes without backward compatibility in our images and reflected in our changelog. It may be worked for you perfectly but it did not for others. Which is the main reason why we changed the caching logic in the first place, we now use the same approach for WP as we've been using in Drupal preset for years.
If you need to preserve additional WP cookies you can always override $VARNISH_WP_PRESERVED_COOKIES
.
what is the purpose of VARNISH_KEEP_ALL_COOKIES than?
I've already replied here above, also simple search in README will help you.
It would be much easier if this config would be working VARNISHD_VCL_SCRIPT but it’s not
Why not? We do not limit usage of any environment variables. Or do you refer to the managed stack on Wodby platform? Please note it's a public repository of the docker image that people use outside of Wodby.
you told us to use the configs but this one does not work on the prod server
This is not the support channel for your application.
--
I'm going to lock this issue since I couldn't recognize any valid bug reports for this image.
from varnish.
Related Issues (20)
- Compile varnish from sources HOT 1
- Support of WooCommerce cart cookies HOT 2
- Possible config issues HOT 2
- Problem with purge key HOT 11
- Idea: cache POST request with specific header HOT 2
- Make VCKEY cookies available on backend HOT 1
- Varnish modules not imported [SOLVED] HOT 1
- WordPress caching not working
- Varnish caching Drupal private files HOT 9
- An Instruction HOT 1
- Add mod dynamic
- Drupal preset - cache public static files for authenticated users. HOT 1
- Drupal Preset SESS[a-z0-9]+|SSESS[a-z0-9]+|NO_CACHE not appended HOT 1
- Arm images missing HOT 5
- Varnish is not compiling - container exit code 2 HOT 3
- varnish cache tag invalidation not working with drupal 8. HOT 2
- Drupal responsive image styles not generated when requested by anonymous users HOT 1
- Upgrade alpine to 3.17
- Customize cache hash key via cookies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from varnish.