tractorcow / silverstripe-dynamiccache

Simple on the fly caching of dynamic content for Silverstripe
39 stars 27 forks source link

Multiple Caches per Page #44

Closed thezenmonkey closed 8 years ago

thezenmonkey commented 8 years ago

I'm evaluating using the module on an upcoming project and I was wondring if it's possible to have multiple versions of a cached page. For instance one cached version for normal visitiors and a second version for registered users. The page doesn't need to display specific user data, just reveal hidden page content for logged-in users.

michaelbollig commented 8 years ago

You sure can thezenmonkey. Check out https://github.com/tractorcow/silverstripe-dynamiccache#customising-cache-behaviour — by changing the cache key fragment to include whether the user is logged in or not, you can serve one version of the page to logged in users and another to normal visitors.

tractorcow commented 8 years ago

Cool, thanks for the response @michaelbollig ! I guess that closes this ticket. :D