Reputation: 49583
I have a component in my web application (the menu) that is rendered for every page, and it's useless and takes up resources.
Is there a way to put a cache on this component, so that its HTML output is cached?
Note: I already use EhCache, maybe there's a way to interface them?
Upvotes: 0
Views: 942
Reputation: 38309
If this app is under extreme load you might want to consider using edge side includes. With a caching proxy such as Varnish you can then cache fragments of a page so that you won't have to regenerate those parts of the page on each request. There's a good explanation of the process in this article.
Upvotes: 0
Reputation: 11
Have a look at :
Looks nice, even if I wished more flexibility to the cache names which are stuck to an Enum (CacheRegion)
Upvotes: 1
Reputation: 2337
Unless your component does some database access or other heavy work, there's no point in caching it; it would just be premature optimizations. Further, its best to cache the data used by the component, rather than attempting to cache the output of the component.
Upvotes: 0
Reputation: 29947
The company I work for created a Tapestry cache extension to do this. I haven't used in a while, but we used it on some quite big sites in the last few years and gave us some good results.
Upvotes: 1