Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: How to implement custom service layer cache using MultiVMPool ?
ref: https://liferay.dev/blogs/-/blogs/liferay-caching-service-level-caching-using-webcachepool.
According to this blog, WebCachePool internally uses SingleVMPool. I'm looking for a similar approach which is suitable for Multi-node environment.
Thanks!
According to this blog, WebCachePool internally uses SingleVMPool. I'm looking for a similar approach which is suitable for Multi-node environment.
Thanks!
Here's the code for WebCachePool:
https://github.com/liferay/liferay-portal/blob/7.2.x/portal-impl/src/com/liferay/portal/webcache/WebCachePoolImpl.java
But honestly speaking, I never found the interface of the WebCachePool very convenient. I usually just use a simpler implementation with put /get. It is often inconvenient to create a WebCacheItem. But that's just an opinion.
https://github.com/liferay/liferay-portal/blob/7.2.x/portal-impl/src/com/liferay/portal/webcache/WebCachePoolImpl.java
But honestly speaking, I never found the interface of the WebCachePool very convenient. I usually just use a simpler implementation with put /get. It is often inconvenient to create a WebCacheItem. But that's just an opinion.
Christoph Rabel:
Here's the code for WebCachePool:
https://github.com/liferay/liferay-portal/blob/7.2.x/portal-impl/src/com/liferay/portal/webcache/WebCachePoolImpl.java
But honestly speaking, I never found the interface of the WebCachePool very convenient. I usually just use a simpler implementation with put /get. It is often inconvenient to create a WebCacheItem. But that's just an opinion.
Thanks Christoph, It worked. We are using WebCacheItem to set different refresh time for each cached item.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™