Forums / Setup & design / search with different layout and caching

search with different layout and caching

Author Message

Heiner Wurbs

Friday 17 December 2004 3:42:39 am

Hi all,

I have a problem with search and caching. My main pagelayout.tpl requires a complete caching for a performant access. But now I have a problem with the search. The keys I can assign to the cache-blocks are not usefull for the search, because the uri of the search doesnt change, it is always "content/search":

This doesnt work for search, but for any other content in pagelayout.tpl:

{cache-block keys=array($uri_string)}
{/cache-block}

As a solution I created a new layout and a new pagelayout for the search, search_pagelayout.tpl without any cache blocks. This works fine, the search itself caches not anymore, except the google-navigator :(

This is my new search template:
/layout/set/searchlayout/content/search?SearchText=about+ez

The google-navigator url for the next searchresult page is:
/layout/set/searchlayout/content/search/(offset)/10?SearchText=about+ez

But it shows always the same page, the first.

By the way, if you solve one problem, there is always the next coming up; as a result of the changing of the layout, every link created with {$node.url_alias} is now switched to the searchlayout, which I didnt wanted. My (bad) solution is to eliminate the url_alias and use easy "/{$node.url_alias}". But this is obviously not recommended.

Now the question: does anyone have some ideas?

Heiner

Heiner Wurbs

Friday 17 December 2004 5:34:28 am

Hi,
I found a better solution which works fine:

I removed the search layout, I'm using again ezurl and I using this specific Cache-Block keys:

{cache-block keys=array($uri_string,$search_text,$view_parameters.offset)}