FriendsOfSymfony / FOSHttpCache

Integrate your PHP application with your HTTP caching proxy
https://foshttpcache.readthedocs.io
Other
353 stars 60 forks source link

Propose user hash shortcut for anonymous users #132

Closed dbu closed 9 years ago

dbu commented 9 years ago

follow up of https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/pull/152/files#r19613053

ez does a clever trick in their varnish configuration to avoid a hash lookup for the anonymous users: https://github.com/ezsystems/ezpublish-community/pull/198/files#diff-e135af71540ad18dca44b9b3949162baR142

varnish is probably even faster with restarting the request than the symfony cache, but it could still be beneficial for scenarios where many users are anonymous anyways.

this would just be something to add to the varnish configuration examples and explain in the user context documentation, no need to do anything on the php side.

lolautruche commented 9 years ago

More readable link: https://github.com/ezsystems/ezpublish-community/blob/master/doc/varnish/vcl/varnish4.vcl#L137-L141

lolautruche commented 9 years ago

Might not save much as Varnish is already very performant, but it at least avoids a whole request restart + cache lookup when it's not needed.

dbu commented 9 years ago

why is that hash not simply "anonymous" to make it even more obvious?

lolautruche commented 9 years ago

Just for geek fun :-)

ddeboer commented 9 years ago

Please continue discussion in #182.