Does liferay support caching for custom service layer by default or are we supposed to cache service calls using WebCachePool?If yes,how can we achieve the same and is the same approach need to be followed for external service calls,not generated through Liferay service builder?
Asked
Active
Viewed 774 times
2 Answers
1
When you build a custom entity based on liferay service builder the cache layer is provived by default. You can control it, disable it if you need it or change caching rules.
Without service builder layer, you manually use many cache util classes available from the portal code.
Look at this code to have an example:

Daniele Baggio
- 2,157
- 1
- 14
- 21
-
Could you please update your answer to clarify more on,in order to control or disable cache on entities from service builder,do we manipulate on finderCache,as given in Blogs example?And also are there specific scenarios for when to use SingleVMPool and MultiVMPool utils,apart from nodes for the Liferay instance – Shivam Aggarwal Jan 31 '17 at 11:11
-
Follow this https://web.liferay.com/it/community/wiki/-/wiki/Main/ehCache+Configuration – Daniele Baggio Jan 31 '17 at 11:13
-
I downvoted answer as provided LINKS are dead, and given answer just repeats the keywords from the question – igor.beslic Jul 15 '20 at 11:36
-
1@igor.beslic I've fixed the url. keywords are repeated to explain better the topic. – Daniele Baggio Jul 15 '20 at 12:22
0
If you need it, you can disable the cache for just a custom entity that you are using, in my case it worked because the entity i was having cache issues was being updated constantly, so i disabled the cache just for that entity adding cache-enabled="false" to the service xml:
<entity name="CustomEntity" local-service="true" remote-service="true" cache-enabled="false">
as you can see in this article:
https://liferaydeveloper.com/custom-finders-using-service-builder---liferay-6.2-/-7.x.html
Greetings.

Eduardo Pantoja
- 1
- 1