Fórum

Liferay Caching

Timothy Bassett, modificado 9 Anos atrás.

Liferay Caching

New Member Postagens: 7 Data de Entrada: 11/09/14 Postagens Recentes
We are looking at using the standard liferay proxy page level caching on our newly built liferay website. However I have discovered that if a admin user views a page that is not cached, the newly created cache version (which will be visible to our users) contains the Liferay control panel or any admin messages that were showing when the page was cached.

Is their any way to prevent the control panel bar or any other admin component from being cached for the public to see?
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: Liferay Caching

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
No, that would be a function of the system doing the caching, not of Liferay.

An alternative would be to give your admins a different path that does not go through the cache system. That way they can do their thing but the cache system won't see the page or retain it for caching.
Timothy Bassett, modificado 9 Anos atrás.

RE: Liferay Caching

New Member Postagens: 7 Data de Entrada: 11/09/14 Postagens Recentes
I think I may not have explained the issue correct. I Have attached a screenshot of the homepage. At the very top you see the Liferay Control Panel which appears for admin users. However when doing page level cache, this control panel gets cached and is available for the public.

Liferay is not a framework that I have used before but surly there is a way to prevent liferay from caching admin features (like the control panel) from the general public.
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: Liferay Caching

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
No.

I'm sure you understand how it works, but for those that happen upon this thread that don't understand...

A page level cache is an appliance (hardware or software, service implementation, etc.) that will cache a page rendered by a back end server and return it for all incoming requests that match the incoming URL.

These can work great for like any guest page of your Liferay site because they typically have no change from one guest to the next, so it is typically fine for this appliance to return the cached page instead of passing it through to Liferay to render.

Your problem, Timothy, is that when you log in, the URL can still be an average guest URL such as /web/guest/welcome. Even though you're logged in, the URL doesn't indicate as much.

So, like you said, when you navigate to a page that the cache appliance hasn't seen before such as /web/guest/newpage, the cache appliance has nothing to return so it lets Liferay render it. Liferay does it's thing but, since you are logged in, includes the dock bar because that's what Liferay should do.

Unfortunately, the cache appliance now has a page that it, in turn, will return it for every match to /web/guest/newpage and that's just what you don't want to have happen because the guest cannot and should not see the dock bar.

But this is the rub - you see it as something that Liferay should or shouldn't be doing, but it's not really a Liferay problem, the problem is the URLs just don't indicate guest vs authenticated user, so the cache appliance sees it as the same thing.

Now you could have your admins log into the app server directly, i.e. http://mytomcat:8080/... and bypassing the cache appliance. This way you and your admins can create and manage pages but you won't end up polluting your cache appliance.
thumbnail
Jack Bakker, modificado 9 Anos atrás.

RE: Liferay Caching

Liferay Master Postagens: 978 Data de Entrada: 03/01/10 Postagens Recentes
Hi Timothy,

While David is obviously trying out his new speech-to-text software emoticon , there is the question of 'what' is doing the proxy caching exactly. Given who knows what proxies might be there between your Liferay and someone's browser : best to go over ssl for at least private pages...

In your portal-ext.properties file do you require ssl for private pages ?

company.security.auth.requires.https=true

--

And then you may even use the below to put your whole site over ssl (if your marketing people complain, tell them Google is supposedly ranking sites with https higher)

web.server.protocol=https
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: Liferay Caching

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Jack Bakker:
While David is obviously trying out his new speech-to-text software emoticon


Is that code for TL;DR? emoticon