Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Alejandro López
Apache cache and search problem
September 11, 2012 2:12 AM
Answer

Alejandro López

Rank: Junior Member

Posts: 53

Join Date: July 8, 2011

Recent Posts

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?
Hitoshi Ozawa
RE: Apache cache and search problem
August 16, 2012 7:07 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

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
RE: Apache cache and search problem
August 17, 2012 1:53 AM
Answer

Alejandro López

Rank: Junior Member

Posts: 53

Join Date: July 8, 2011

Recent Posts

Hi Hitoshi.

I think you're right and it's apache configuration. When solved, I will write solution.
Thanks
Hitoshi Ozawa
RE: Apache cache and search problem
August 17, 2012 5:43 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Which tool are you using to connect Apache and Tomcat? Which modules are you enabling?
Alejandro López
RE: Apache cache and search problem
September 11, 2012 3:02 AM
Answer

Alejandro López

Rank: Junior Member

Posts: 53

Join Date: July 8, 2011

Recent Posts

Sorry but I only know that we are using Mod Disk Cache.
Alejandro López
RE: Apache cache and search problem
September 12, 2012 4:46 AM
Answer

Alejandro López

Rank: Junior Member

Posts: 53

Join Date: July 8, 2011

Recent Posts

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
RE: Apache cache and search problem
September 12, 2012 7:33 AM
Answer

Alejandro López

Rank: Junior Member

Posts: 53

Join Date: July 8, 2011

Recent Posts

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
Mika Koivisto
RE: Apache cache and search problem
September 12, 2012 4:24 PM
Answer

Mika Koivisto

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1513

Join Date: August 7, 2006

Recent Posts

Don't cache the pages on Apache.
Alejandro López
RE: Apache cache and search problem
September 13, 2012 12:50 AM
Answer

Alejandro López

Rank: Junior Member

Posts: 53

Join Date: July 8, 2011

Recent Posts

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
Juan Gonzalez
RE: Apache cache and search problem
September 13, 2012 8:57 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2797

Join Date: October 28, 2008

Recent Posts

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
RE: Apache cache and search problem
September 13, 2012 9:43 AM
Answer

Alejandro López

Rank: Junior Member

Posts: 53

Join Date: July 8, 2011

Recent Posts

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!!