Foros de discusión

Apache cache and search problem

Alejandro López, modificado hace 11 años.

Apache cache and search problem

Junior Member Mensajes: 53 Fecha de incorporación: 8/07/11 Mensajes recientes
Hi.

I have Liferay installed on 2 nodes, deployed on a Weblogic and behind a Apache Web Server.

There was all ok, but 2 days ago, I've enabled apache cache, and when I make some search, sometimes the searcher returns blank page (there's no any message "No results were found that matched the keywords" ).

I'm using Federated Search Portlet (ID 3) embedded on theme.

If I disable apache cache, all works ok. When start up apache cache, at first seems that searcher works ok (¿until the page is cached?)

I don't know what's happening.

Any suggestion?
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: Apache cache and search problem

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
You're probably caching dynamic content too. Set your apache to only cache static content.

Also, check if permission is working alright when cache is enabled.
Alejandro López, modificado hace 11 años.

RE: Apache cache and search problem

Junior Member Mensajes: 53 Fecha de incorporación: 8/07/11 Mensajes recientes
Hi Hitoshi.

I think you're right and it's apache configuration. When solved, I will write solution.
Thanks
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: Apache cache and search problem

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
Which tool are you using to connect Apache and Tomcat? Which modules are you enabling?
Alejandro López, modificado hace 11 años.

RE: Apache cache and search problem

Junior Member Mensajes: 53 Fecha de incorporación: 8/07/11 Mensajes recientes
Sorry but I only know that we are using Mod Disk Cache.
Alejandro López, modificado hace 11 años.

RE: Apache cache and search problem

Junior Member Mensajes: 53 Fecha de incorporación: 8/07/11 Mensajes recientes
I think, that when I make a request to a page, for example:
http://SERVER/es/web/descripcion

This page is cached and returned correctly.

But if I make a search situated at this page, the URL it's similar:
http://SERVER/es/web/descripcion?p_p_auth=SJ2SRzAT&p_p_id=3&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_count=3&_3_struts_action=%2Fsearch%2Fsearch

Then, because the page "descripcion" is cached. Search don't works.

When cache is empty, searcher works ok.

I nedd to configure Apache Server to avoid a response from cache if the request has some of this parameters.
p_p_auth=SJ2SRzAT&p_p_id=3&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_count=3&_3_struts_action=%2Fsearch%2Fsearch

Anyone can help.

We're using MOD_DISK_CACHE

Thanks in advance.
Alejandro López, modificado hace 11 años.

RE: Apache cache and search problem

Junior Member Mensajes: 53 Fecha de incorporación: 8/07/11 Mensajes recientes
Hi.

I've think another solution is create one page for search results ("/es/web/search") and configure portlet to redirect always to this page.

If I use a portlet on a page, I can make it by "Look and Feel" tab of the portlet (option "Link to URL"), but I have the portlet embedded on theme.

How can I configure this on a portlet embedded on theme? Some option on "liferay-portlet.xml" or "portlet-custom.xml"?

Thanks


pd: I'm using Liferay 6.0
thumbnail
Mika Koivisto, modificado hace 11 años.

RE: Apache cache and search problem

Liferay Legend Mensajes: 1519 Fecha de incorporación: 7/08/06 Mensajes recientes
Don't cache the pages on Apache.
Alejandro López, modificado hace 11 años.

RE: Apache cache and search problem

Junior Member Mensajes: 53 Fecha de incorporación: 8/07/11 Mensajes recientes
But caching pages on Apache improves performance a lot . I think it's necessary.

How can I set "Link to page" attribute in the embeded search portlet?

Thanks
thumbnail
Juan Gonzalez P, modificado hace 11 años.

RE: Apache cache and search problem

Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Hola Alejandro.

Caching pages can be a huge mistake if it isn't configured properly. IMHO it doesn't have any sense in CMS, pages are dynamic content. Resources can be cached because most of them are static, but that's all.

For example, whenever you change a web content you should clear the cache in Apache. And that's an awful maintenance (CMS should be easy to mantain).

Liferay caches a lot of things on its own (for example images, documents, css, etc), so I guess you don't have to worry about this.
Alejandro López, modificado hace 11 años.

RE: Apache cache and search problem

Junior Member Mensajes: 53 Fecha de incorporación: 8/07/11 Mensajes recientes
Hola Juan, y gracias.

In my case, the content will be modified rarely. For that reason, we think Apache is necessary and improves performance of the responses.

I don't know which is cache set up. That's the reason I'm trying to redirect searches to a new page (not cached).

Maybe is better disable apache cache. I'll think about it.

Gracias!!