Hi Ben! this looks good! i would really start to be interested when invalidation part has taken a step further, where you can associate different kind of invalidators, depending on the cache type but also the component type. Two "simple" cache invalidators i can think of would be: - check cache date against last modified date for simple cache, - check cache against child cache invalidators for aggregated cache.
also "resource base caching" is not enough imo to reflect what this is doing, which is caching the scripting rendering results ... scripting cache tree? i'm not at adapt To neither, and really sad about it ! Nicolas Le dim. 1 sept. 2019 à 14:49, Ben Zahler <[email protected]> a écrit : > Dear Sling-Devs, > > A long time ago, I proposed implementing resource based caching in Sling: > http://apache-sling.73963.n3.nabble.com/Idea-Caching-in-Sling-td4036886.html > > > > I did get some nice feedback, but unfortunately the daily life forces > proved to be too strong and I never followed up on this. > > > > Finally, a few months ago I decided to start a POC and I feel that’s in a > state where I can share it with you. > > > > The idea in a nutshell: > Cache the output of Sling requests in memory (infinispan) > Allow developers to configure component behavior (e.g. re-render specific > components for each request) > > > Source Code and Documentation can be found here: > > https://gitlab.com/hit-the-cache-jack/hit-the-cache-jack/wikis/home > > > > Some points to consider: > Code is for a POC, I think it’s in reasonably good state but of course far > from production coding standards > The code has some AEM dependencies, but I have already implemented the > concepts to make this 100% sling specific > > > I have set up a demo environment with one AEM Publish instance running the > We-Retail application. > > The following things can be observed there: > Top navigation is cached correctly for both logged in and anonymous users > Cart is displayed in top navigation correctly per user, adding items to > the cart works > CSRF tokens are generated correctly > All the regular page content is fully read from the in memory cache. > > > The demo environment can be accessed in three ways: > > · direct access with caching POC enabled > > · Cloudflare-caching for static content (images, JS and CSS files) POC > code used for all other content > > · Default AEM dispatcher cache (sling caching POC is disabled) > > > > Feel free to log in with user1/user1 or user2/user2 to test the cart. > > > > I know this is quite a significant intervention into how sling works, > there are quite a few risks associated with this that I may not even be > aware of. > > Still, if you think this could be interesting to be integrated into Sling > in one way or another, I’m very happy to donate my source code. > > > > I hoped I would be able to join adapt.to to discuss this with you, but I > can’t make it for more than one day, so I decided to skip adapt.to > (again) this year. > > Would be great to get some feedback if this is of any interest to you and > maybe even get some input on what must be improved and changed. > > > > Thanks for any feedback! > > Ben > > > > > > -- > > Ben Zahler > > Hit the code jack gmbh | Bergweg 17 | CH-4450 Sissach > > Phone: +41 79 570 8052 | https://www.hitthecodejack.com/ > > > >
