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)}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 11:02:41
Script start
Timing: Jan 19 2025 11:02:41
Module start 'layout'
Timing: Jan 19 2025 11:02:41
Module start 'content'
Timing: Jan 19 2025 11:02:42
Module end 'content'
Timing: Jan 19 2025 11:02:42
Script end

Main resources:

Total runtime0.8663 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.2891152.6406
Module start 'layout' 0.00520.0034 741.929739.4766
Module start 'content' 0.00860.8560 781.4063429.4531
Module end 'content' 0.86460.0016 1,210.85948.1250
Script end 0.8662  1,218.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3492160.0002
Check MTime0.00120.1390160.0001
Mysql Total
Database connection0.00060.074010.0006
Mysqli_queries0.818894.5160520.0157
Looping result0.00050.0537500.0000
Template Total0.830195.820.4150
Template load0.00240.274620.0012
Template processing0.827795.540020.4138
Template load and register function0.00050.060010.0005
states
state_id_array0.00090.107210.0009
state_identifier_array0.00220.250720.0011
Override
Cache load0.00200.2251210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.071010.0006
Fetch class attribute name0.00140.161820.0007
XML
Image XML parsing0.00010.012210.0001
class_abstraction
Instantiating content class attribute0.00000.000820.0000
General
dbfile0.00160.1792100.0002
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs