Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Luca Lupo
Cache an entire html page
December 19, 2012 12:30 AM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

Hi Guys,

I want to cache the home page of my portal. When I talk about cache I mean the html of page. That means that the first time the page is not in cache I need to cache that. The cache doesn't have to expire but I will create a portlet for the admin area (I do not need info here) for clear the cache.

Any idea?

Thanks

Luc
Hitoshi Ozawa
RE: Cache an entire html page
December 19, 2012 12:54 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

You can try setting up a httpd server like Apache in front of liferay to cache static pages. I think most users are doing it this way in production environment to increase performance.
Luca Lupo
RE: Cache an entire html page
December 20, 2012 7:00 AM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

Well, Liferay uses Apache. I dunno how to set the cache and free it emoticon

Hint?

Thanks
Milen Dyankov
RE: Cache an entire html page
December 21, 2012 2:59 AM
Answer

Milen Dyankov

LIFERAY STAFF

Rank: Regular Member

Posts: 224

Join Date: October 30, 2012

Recent Posts

In case you are not aware the portal is already caching some requests/pages (assuming you have not disabled that). For more information see CacheFilter class. If that is not sufficient for you the you may introduce your own filter that only caches the main page (or whatever you need) in memory, Liferay's EHCache or any other cache you are familiar with. Use this with caution though as:
- the page HTML will most likely differ depending on user's browser, OS, etc.
- you'll have to decide how URL parameters affect your cache
- you may end up showing your users stale data
- in a worst case scenario you may cache user specific data and then show it to all other users.
Niccolò Seri
RE: Cache an entire html page
December 24, 2012 1:10 AM
Answer

Niccolò Seri

Rank: New Member

Posts: 11

Join Date: September 26, 2012

Recent Posts

Milen Dyankov:
In case you are not aware the portal is already caching some requests/pages (assuming you have not disabled that). For more information see CacheFilter class. If that is not sufficient for you the you may introduce your own filter that only caches the main page (or whatever you need) in memory, Liferay's EHCache or any other cache you are familiar with. Use this with caution though as:
- the page HTML will most likely differ depending on user's browser, OS, etc.
- you'll have to decide how URL parameters affect your cache
- you may end up showing your users stale data
- in a worst case scenario you may cache user specific data and then show it to all other users.


Hi Milen,
I have the same problem as Luca. I am trying to debug CacheFilter class, but the execution doesn't stop to any breakpoint I setted on that class. I assume that I need to set up something.