问题
What kind of cache Hippo cms is using?
I found something about bundle cache on official page, but I don't have idea where information are stored and how get them out.
Main problem is I need synchronize L2cache between a lot of instances of Hippo cms application.
回答1:
Hippo CMS has caching implemented at several different levels of the overall architecture. It's important to keep in mind that the Hippo stack has 3 main components:
- The content repository (backed by an RDBMS)
- The Hippo delivery tier (HST)
- The Hippo CMS UI
My assumption is that you're probably trying to do this for the delivery part of the application. Let's take a bottom-up approach and see what different types of caching are available.
The content repository caches raw data from the persistence layer in the Bundle Cache. This is an in-memory cache provided by Apache Jackrabbit and its size can be configured in the repository.xml. You can already consider this an L2 Cache if you would compare this to for instance Hibernate, since it's shared by all JCR sessions. You can find more information on how to tune this cache on the corresponding documentation page.
The Hippo delivery tier uses a couple of in-memory model representations derived from repository configuration and four different caches: Binaries Cache, WebFiles Cache, Node Cache and Page Cache.
The Binaries Cache is used to cache static resources that are stored in the content repository, such as PDFs and images. It can be configured to be served from memory or disk. The binaries cache is using Ehcache in the background. More information on how to configure or specify your own cache can be found here.
The WebFiles Cache is used to also cache static resources from the repository, but instead of typically user content like PDFs and images, it is more developer static webapp content.
The Node Cache caches the contents of individual JCR nodes retrieved from the content repository. This includes actual content items (documents) as well as configuration stored in the repository such as web page layouts and URL mappings. The observation pattern is used to invalidate node cache entries when the original node in the repository is modified.
The Page Cache caches complete aggregated pages. This means that web pages can be served directly from cache without any content retrieval and page aggregation as long as no modifications are made to the content and configuration making up the page. Once any of these is modified the delivery tier is notified through observation and invalidates the cached page. Requests arriving while the modified page is being aggregated can be served a stale cache entry to keep response times low. More information can be found here. The page cache is based on ehcache and can be configured through Spring configuration.
As you can see there are several levels of caching available. You have to keep in mind though that if you have multiple Hippo instances running, the caches will be automatically invalidated on all individual instances because of how clustering and cache invalidation works within Hippo, so in the end you might not even need to introduce additional caching.
You can find more information on the performance documentation page.
来源:https://stackoverflow.com/questions/32092560/hippo-cms-cache-method