2

I've used the template partials method to "uprade" one of my site's template to this approach.

What I don't understand is, that although my stash template only has one single embed vs. 5 embeds, it's still performing considerably slower and uses more queries!

the "normal" templates uses about 93 to 95 queries and renders in around 0.5 seconds

the new approach takes from 95 to 98 queries and renders usually in about 1seconds.

you can really feel the difference in speed and rendering.

I am really new to template partials and maybe one of the pro's could look if I am doing something wrong?!

so here's my standard template - before stash (it's a structure powered site)

{gv_doctype}
{preload_replace:pre_prefix="static"}
{if in_group(1)}{preload_replace:pre_status="open|Draft"}{/if}{preload_replace:pre_status="open"}
{exp:channel:entries channel="ch_static"  limit="1" status="{pre_status}" disable="categories|member_data|pagination"}
{embed="_includes/_head" emb_entry_id="{entry_id}"}
{sp_color}
</head>
<body id="{segment_1}">

{embed="_includes/_admin"}
{gv_start}

    {embed="_includes/_header"}
    <section id="content_container">
        {embed="_includes/_navigation" emb_status="{pre_status}"}

        {exp:nsm_transplant:body}
            {cf_static_block_matrix}
                <article class="content_block{if status == 'Draft'} logged_in{/if}">
                    {if title}<h1>{title}</h1>{/if}
                    {if media AND text}
                        <div class="image">
                            {media}
                        </div>
                        <div class="text">
                            {text}
                        </div>
                    {if:else}
                        {text}{media}
                    {/if}
                </article><!-- end content_block -->
            {/cf_static_block_matrix}
            {!--

                video, slideshow and file replacement with {pre_prefix}

            --}
            {sp_static_img_replacement}             
            {sp_video_replacement}
            {sp_file_replacement}
        {/exp:nsm_transplant:body}
        {sp_edit}
    </section><!-- end #content_container -->
    {embed="_includes/_footer"}

{gv_before_end}
{embed="_includes/_end"}

<script type="text/javascript">  
    jQuery(function($){
        $.supersized({
            //Background image
            slides  :  [ { image : '{cf_{pre_prefix}_background limit="1"}{url:max_size}{/cf_{pre_prefix}_background}' } ]
        });
    }); 
</script>

{/exp:channel:entries}
{gv_end}

and here's my new 2 templates:

the wrapper template:

<!DOCTYPE html>
<html lang="de">
<head>

    <meta charset="utf-8" />
    {exp:seo_lite entry_id="{exp:stash:get name='entry_id'}" parse="inward"}
    <meta property="og:site_name" content="..."/>
    <meta property="og:title" content="{exp:stash:get name='title'}" />
    {sp_global_head}
    {exp:stash:get name='color'}

</head>
<body id="{segment_1}">

{embed="_includes/_admin"}

{gv_start}

    <header id="header">
        <h1 id="logo"><a href="{path=''}" class="hide-text">...</a></h1>
    </header>   

    <section id="content_container">
        <!-- main navigation -->
        <nav id="main_nav">     
            {exp:structure:nav start_from="/" max_depth="1" status="{exp:stash:get name='status'}" css_id="none" parse="inward"}
        </nav><!-- end main_nav -->
        {exp:stash:get name='main_content'} 
    </section><!-- end #content_container -->

    <footer id="footer">
        <p>...</p>  
    </footer><!-- end #footer -->

{gv_before_end}
{embed="_includes/_end"}

<script type="text/javascript">  
    jQuery(function($){
        $.supersized({
            //Background image
            slides  :  [ { image : '{exp:stash:get name='background_image'}' } ]
        });
    }); 
</script>
{gv_end}

the other one:

{!--

    View Model Static

--}
{embed="_wrapper/_standard"}

{preload_replace:pre_prefix="static"}
{if in_group(1)}{preload_replace:pre_status="open|Draft"}{/if}{preload_replace:pre_status="open"}

{exp:channel:entries channel="ch_static"  limit="1" status="{pre_status}" disable="categories|member_data|pagination"}
    {exp:stash:set scope="site"}
        {stash:entry_id}{entry_id}{/stash:entry_id}
        {stash:title}{title}{/stash:title}
        {stash:status}{pre_status}{/stash:status}
        {stash:background_image}{cf_{pre_prefix}_background limit="1"}{url:max_size}{/cf_{pre_prefix}_background}{/stash:background_image}
        {stash:color}{sp_color}{/stash:color}
    {/exp:stash:set}
    {exp:stash:set scope="site" parse_tags='yes' parse_conditionals='yes' save='yes' refresh='60'}
        {stash:main_content}
            {exp:nsm_transplant:body}
                {cf_{pre_prefix}_block_matrix}
                    <article class="content_block{if status == 'Draft'} logged_in{/if}">
                        {if title}<h1>{title}</h1>{/if}
                        {if media AND text}
                            <div class="image">
                                {media}
                            </div>
                            <div class="text">
                                {text}
                            </div>
                        {if:else}
                            {text}{media}
                        {/if}
                    </article><!-- end content_block -->
                {/cf_{pre_prefix}_block_matrix}
                {!--

                    images, video and file replacement with {pre_prefix}

                --}
                {sp_static_img_replacement}             
                {sp_video_replacement}
                {sp_file_replacement}
            {/exp:nsm_transplant:body}
            {sp_edit}
        {/stash:main_content}
    {/exp:stash:set}  
{/exp:channel:entries}

now I love this new approach, but I really don't want to compromise the speed of the site!

any help appreciated! cheers stefan

2
  • what if you turn on the output profiler and template debugging and compare then? Where's the bottleneck? – erwinheiser Feb 11 '13 at 15:47
  • I've tried that, but I couldn't really tell where the bottleneck was... I was thinking that maybe somebody spots an error by looking at those examples... can you tell that there's something wrong in my logic? – outline4 Feb 11 '13 at 18:17
1

After fiddling around with various options my templates look like this:

the wrapper template:

<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="utf-8" />
    {exp:seo_lite entry_id="{exp:stash:get name='entry_id'}" parse="inward"}
    <meta property="og:site_name" content="Café Kairo Lorraine"/>
    <meta property="og:title" content="{exp:stash:get name='title'}" />
    <meta property="og:image" content="{exp:stash:get name='og_image'}" />
    {sp_global_head}
    {exp:stash:get name='color'}

</head>
<body id="{segment_1}">

{sp_admin}

{gv_start}

    <header id="header">
        <h1 id="logo"><a href="{path='/'}" class="hide-text">...</a></h1>
    </header>   

    <section id="content_container">
        <!-- main navigation -->
        <nav id="main_nav">     
            {exp:structure:nav start_from="/" max_depth="1" status="{exp:stash:get name='status'}" css_id="none" parse="inward"}
        </nav><!-- end main_nav -->
        {!-- getting the main content and replacing the needles --}
        {exp:stash:parse process="end"}{exp:stash:get name='main_content'}{/exp:stash:parse}

        {!-- edit links --}         
        {exp:stash:get name='edit_main_content' scope="user"}
    </section><!-- end #content_container -->

    <footer id="footer">
        <p>...</p>  
    </footer><!-- end #footer -->

{gv_before_end}

{sp_end}

<script type="text/javascript">  
    jQuery(function($){
        $.supersized({
            //Background image
            slides  :  [ { image : '{exp:stash:get name='background_image'}' } ]
        });
    }); 
</script>
{gv_end}

the standard template:

{embed="_wrapper/_standard"}

{preload_replace:pre_prefix="static"}
{if in_group(1)}{preload_replace:pre_status="open|Draft"}{/if}{preload_replace:pre_status="open"}

{exp:channel:entries channel="ch_static" limit="1" status="{pre_status}" disable="categories|member_data|pagination"}

    {!-- misc stuff --}
    {exp:stash:set scope="site"}
        {stash:entry_id}{entry_id}{/stash:entry_id}
        {stash:title}{title}{/stash:title}
        {stash:og_image}{cf_{pre_prefix}_images_matrix limit="1"}{exp:ce_img:pair src="{image_url:url:max_size}" width="250"}{made}{/exp:ce_img:pair}{/cf_{pre_prefix}_images_matrix}{/stash:og_image}
        {stash:status}{pre_status}{/stash:status}
        {stash:background_image}{cf_{pre_prefix}_background limit="1"}{url:max_size}{/cf_{pre_prefix}_background}{/stash:background_image}
        {stash:color}{sp_color}{/stash:color}
    {/exp:stash:set}

    {!-- preparing the content, but not outputting it yet --}
    {exp:stash:set scope="site" name="main_content" parse_tags="yes" parse_conditionals="yes" output="no"}
        {cf_{pre_prefix}_block_matrix}
            <article class="content_block{if status == 'Draft'} logged_in{/if}">
                {if title}<h1>{title}</h1>{/if}
                {if media AND text}
                    <div class="image">
                        {media}
                    </div>
                    <div class="text">
                        {text}
                    </div>
                {if:else}
                    {text}{media}
                {/if}
            </article><!-- end content_block -->
        {/cf_{pre_prefix}_block_matrix}
        <p class="last_edited hidden"><time datetime="{entry_date format="{sp_datetime_format}"}">Letzte Änderung am {edit_date format="%Y-%m-%d"}</time></p>
    {/exp:stash:set}

    {!-- setting the inline edit links --}
    {exp:stash:set scope="user" name="edit_main_content" parse_tags="yes" parse_conditionals="yes"}
        {if member_group == "1"}<p  class="hide_on_demand"><a class="modalbox_edit" href="/backend/index.php?D=cp&C=content_publish&M=entry_form&channel_id={channel_id}&entry_id={entry_id}" title="Zuerst «Senden» drücken, dann «Schliessen und Neuladen»! Esc um abzubrechen">{title} bearbeiten &uarr;</a></p>{/if}
    {/exp:stash:set}

    {!-- setting the needles --}
    {cf_{pre_prefix}_images_matrix}
        {exp:stash:set name="bild_{row_count}" type="snippet"}
            {if image_zoom == "y"}
                <a class="modalbox_zoom img_link" title="{image_url:title}" href="{exp:ce_img:pair src='{image_url:url:max_size}' width='1200' height='800'}{made}{/exp:ce_img:pair}">
            {/if}
            {exp:switchee variable="{image_size}" parse="inward"}
                {case value="left"}
                    {exp:ce_img:pair src="{image_url:url:max_size}" width="255" allow_scale_larger="yes"}<img src="{made}" class="{image_alignement}" width="{width}" height="{height}" alt="{title} {image_url:title} {image_url:desc} {gv_alt}" />{/exp:ce_img:pair}
                {/case}
                {case value="right"}
                    {exp:ce_img:pair src="{image_url:url:max_size}" width="311" allow_scale_larger="yes"}<img src="{made}" class="{image_alignement}" width="{width}" height="{height}" alt="{title} {image_url:title} {image_url:desc} {gv_alt}" />{/exp:ce_img:pair}
                {/case}
                {case value="full"}
                    {exp:ce_img:pair src="{image_url:url:max_size}" width="600" allow_scale_larger="yes"}<img src="{made}" class="{image_alignement}" width="{width}" height="{height}" alt="{title} {image_url:title} {image_url:desc} {gv_alt}" />{/exp:ce_img:pair}
                {/case}
                {case value="untouched"}
                    <img src="{image_url:url}" width="{image_url:width}" height="{image_url:height}" alt="{title} {image_url:title} {image_url:desc}" class="small_image img_link" />
                {/case}
            {/exp:switchee}
            {if image_zoom == "y"}</a>{/if} 
        {/exp:stash:set}
    {/cf_{pre_prefix}_images_matrix}
{/exp:channel:entries}

and here's the log file:

TEMPLATE DEBUGGING
(0.000057 / 13.35MB) - Begin Template Processing -
(0.000177 / 13.35MB) URI: bar
(0.000190 / 13.35MB) Path.php Template: templates/static
(0.000202 / 13.35MB) Retrieving Template
(0.000215 / 13.35MB) Retrieving Template from Database: templates/static
(0.001079 / 13.35MB) Template Found
(0.001152 / 13.36MB) Retrieving Template from File
(0.005293 / 13.80MB) Calling Extension Class/Method: Mo_variables_ext/run
(0.007817 / 14.01MB) Calling Extension Class/Method: Stash_ext/template_fetch_template
(0.007953 / 14.00MB) Template Type: webpage
(0.007973 / 14.00MB) Parsing Site Variables
(0.008046 / 14.00MB) Snippets (Keys): (stripped out)
(0.008134 / 14.02MB) Snippets (Values): (stripped out)
(0.009657 / 14.03MB) Parse Date Format String Constants
(0.009719 / 14.03MB) Parse Current Time Variables
(0.009902 / 14.03MB) Parsing Segment, Embed, and Global Vars Conditionals
(0.011465 / 14.05MB) Processing Preload Text Replacements: pre_prefix|pre_status|pre_status
(0.015727 / 14.13MB) - Beginning Tag Processing -
(0.015758 / 14.12MB) Parsing Tags in Template
(0.015790 / 14.12MB) Tag: {exp:channel:entries channel="ch_static" limit="1" status="open|Draft" disable="categories|member_data|pagination"}
(0.015889 / 14.13MB) Closing Tag Found
(0.015994 / 14.13MB) Processing Tags
(0.016022 / 14.13MB) Module Tag: Channel/entries
(0.016034 / 14.13MB) Including Files for Plugins and Modules
(0.016047 / 14.13MB) Files for Plugins and Modules All Included
(0.016597 / 14.15MB) Beginning Final Tag Data Processing
(0.016614 / 14.15MB) Calling Class/Method: Channel/entries
(0.019813 / 14.17MB) -> Class Called: Channel
(0.021909 / 14.44MB) -> Method Called: entries
(0.063275 / 19.03MB) Calling Extension Class/Method: Assets_ext/channel_entries_query_result
(0.078885 / 20.40MB) Calling Extension Class/Method: Playa_ext/channel_entries_tagdata
(0.080226 / 20.45MB) Calling Extension Class/Method: Matrix_ext/channel_entries_tagdata
(0.252167 / 22.02MB) Calling Extension Class/Method: Pt_field_pack_ext/channel_entries_tagdata
(0.260558 / 22.02MB) -> Data Returned
(0.260695 / 21.97MB) Parsing Tags in Template
(0.260724 / 21.98MB) Tag: {exp:stash:set scope="site"}
(0.260787 / 21.98MB) Closing Tag Found
(0.260863 / 21.98MB) Tag: {exp:stash:set scope="site" name="main_content" parse_tags="yes" parse_conditionals="yes" output="no"}
(0.260930 / 21.98MB) Closing Tag Found
(0.261004 / 21.99MB) Tag: {exp:stash:set scope="user" name="edit_main_content" parse_tags="yes" parse_conditionals="yes"}
(0.261067 / 21.99MB) Closing Tag Found
(0.261121 / 21.99MB) Tag: {exp:ifelse parse="inward"}
(0.261172 / 21.99MB) Closing Tag Found
(0.261242 / 21.99MB) Tag: {exp:ifelse parse="inward"}
(0.261287 / 21.99MB) Closing Tag Found
(0.261331 / 22.00MB) Tag: {exp:ifelse parse="inward"}
(0.261375 / 22.00MB) Closing Tag Found
(0.261409 / 22.00MB) Processing Tags
(0.261455 / 22.00MB) Module Tag: Stash/set
(0.261477 / 22.00MB) Module Tag: Stash/set
(0.261497 / 22.00MB) Module Tag: Stash/set
(0.261525 / 22.00MB) Plugin Tag: Ifelse/
(0.261547 / 22.00MB) Plugin Tag: Ifelse/
(0.261569 / 22.00MB) Plugin Tag: Ifelse/
(0.261584 / 22.00MB) Including Files for Plugins and Modules
(0.267416 / 22.80MB) Files for Plugins and Modules All Included
(0.267441 / 22.80MB) Beginning Final Tag Data Processing
(0.267458 / 22.80MB) Calling Class/Method: Stash/set
(0.267821 / 22.79MB) -> Class Called: Stash
(0.269202 / 22.91MB) -> Method Called: set
(0.269375 / 22.91MB) Stash: SET entry_id to value 1130
(0.269477 / 22.91MB) Stash: SET title to value Bar
(0.269579 / 22.91MB) Stash: SET og_image to value {exp:ce_img:pair src="http://www.mydomain.ch/media/bilder/_max_size/bar.jpg" width="250"}{made}{/exp:ce_img:pair}
(0.269679 / 22.91MB) Stash: SET status to value open|Draft
(0.269782 / 22.92MB) Stash: SET background_image to value http://www.mydomain.ch/media/hintergrund/_max_size/Lueftungstapete.jpg
(0.269902 / 22.92MB) Stash: SET color to value <style> a:hover, .link:hover, #main_nav li a:hover, #main_nav li.here a, #main_nav li.parent-here a { color: #837b3d; } #main_nav { position: relative; float: left; border-bottom-color: #837b3d; } .content_block.line { border-bottom-color: #837b3d; } .time_divider h1 { color: #837b3d; } </style>
(0.269988 / 22.91MB) -> Data Returned
(0.270014 / 22.91MB) Calling Class/Method: Stash/set
(0.270148 / 22.91MB) -> Class Called: Stash
(0.270337 / 22.91MB) -> Method Called: set
(0.270385 / 22.91MB) Stash: processing inner tags
(0.270731 / 22.91MB) Calling Extension Class/Method: Stash_ext/template_fetch_template
(0.272446 / 22.91MB) Calling Extension Class/Method: Mo_variables_ext/cleanup
(0.272631 / 22.91MB) Calling Extension Class/Method: Stash_ext/template_post_parse
(0.273548 / 22.92MB) Calling Extension Class/Method: Structure_ext/template_post_parse
(0.273748 / 22.91MB) Stash: SET main_content to value <article class="content_block"> <h1>Trinken im Kairo</h1> <p>{bild_2}</p> <p>...</p>
(0.273818 / 22.90MB) -> Data Returned
(0.273845 / 22.90MB) Calling Class/Method: Stash/set
(0.273945 / 22.90MB) -> Class Called: Stash
(0.274126 / 22.91MB) -> Method Called: set
(0.274171 / 22.91MB) Stash: processing inner tags
(0.274450 / 22.91MB) Calling Extension Class/Method: Stash_ext/template_fetch_template
(0.275500 / 22.91MB) Calling Extension Class/Method: Mo_variables_ext/cleanup
(0.275673 / 22.91MB) Calling Extension Class/Method: Stash_ext/template_post_parse
(0.276391 / 22.92MB) Calling Extension Class/Method: Structure_ext/template_post_parse
(0.276549 / 22.91MB) Stash: SET edit_main_content to value <p class="hide_on_demand"><a class="modalbox_edit" href="/backend/index.php?D=cp&C=content_publish&M=entry_form&channel_id=1&entry_id=1130" title="Zuerst «Senden» drücken, dann «Schliessen und Neuladen»! Esc um abzubrechen">Bar bearbeiten &uarr;</a></p>
(0.276615 / 22.91MB) -> Data Returned
(0.276641 / 22.90MB) Calling Class/Method: Ifelse/
(0.278100 / 22.92MB) -> Class Called: Ifelse
(0.278576 / 22.93MB) -> Method Called: Ifelse
(0.278648 / 22.93MB) -> Data Returned
(0.278674 / 22.92MB) Calling Class/Method: Ifelse/
(0.278838 / 22.91MB) -> Class Called: Ifelse
(0.279210 / 22.91MB) -> Method Called: Ifelse
(0.279281 / 22.91MB) -> Data Returned
(0.279308 / 22.91MB) Calling Class/Method: Ifelse/
(0.279403 / 22.91MB) -> Class Called: Ifelse
(0.279753 / 22.91MB) -> Method Called: Ifelse
(0.279825 / 22.91MB) -> Data Returned
(0.279877 / 22.87MB) Parsing Tags in Template
(0.279903 / 22.88MB) Tag: {exp:stash:set name="bild_1" type="snippet"}
(0.279965 / 22.88MB) Closing Tag Found
(0.280027 / 22.88MB) Tag: {exp:stash:set name="bild_2" type="snippet"}
(0.280081 / 22.88MB) Closing Tag Found
(0.280137 / 22.88MB) Tag: {exp:stash:set name="datei_1" type="snippet"}
(0.280187 / 22.89MB) Closing Tag Found
(0.280224 / 22.89MB) Processing Tags
(0.280252 / 22.89MB) Module Tag: Stash/set
(0.280273 / 22.89MB) Module Tag: Stash/set
(0.280293 / 22.89MB) Module Tag: Stash/set
(0.280307 / 22.89MB) Including Files for Plugins and Modules
(0.280318 / 22.89MB) Files for Plugins and Modules All Included
(0.280328 / 22.89MB) Beginning Final Tag Data Processing
(0.280340 / 22.89MB) Calling Class/Method: Stash/set
(0.280945 / 22.90MB) -> Class Called: Stash
(0.281131 / 22.90MB) -> Method Called: set
(0.281210 / 22.91MB) Stash: SET bild_1 to value ...
(0.281285 / 22.90MB) -> Data Returned
(0.281308 / 22.90MB) Calling Class/Method: Stash/set
(0.281921 / 22.90MB) -> Class Called: Stash
(0.282105 / 22.91MB) -> Method Called: set
(0.282183 / 22.91MB) Stash: SET bild_2 to value ...
(0.282262 / 22.91MB) -> Data Returned
(0.282286 / 22.90MB) Calling Class/Method: Stash/set
(0.282394 / 22.90MB) -> Class Called: Stash
(0.282590 / 22.90MB) -> Method Called: set
(0.282674 / 22.91MB) Stash: SET datei_1 to value <a href="http://www.mydomain.ch/media/dateien/Kairo_Kellervermietung.pdf" class="download_icon">...</a>
(0.282755 / 22.90MB) -> Data Returned
(0.282781 / 22.90MB) - End Tag Processing -
(0.282827 / 22.90MB) - Processing Sub Templates (Depth: 1) -
(0.282846 / 22.90MB)      List of Embeds: _wrapper/_standard
(0.282896 / 22.90MB)      Processing Sub Template: _wrapper/_standard
(0.282913 / 22.90MB)      Retrieving Template
(0.282927 / 22.90MB)      Retrieving Template from Database: _wrapper/_standard
(0.283956 / 22.91MB)      Template Found
(0.284046 / 22.91MB)      Retrieving Template from File
(0.284630 / 22.93MB)      Calling Extension Class/Method: Stash_ext/template_fetch_template
(0.284762 / 22.91MB)      Template Type: webpage
(0.284792 / 22.91MB)      Parsing Site Variables
(0.284876 / 22.92MB)      Snippets (Keys): (stripped out)|bild_1|bild_2|datei_1
(0.284961 / 22.96MB)      Snippets (Values): (stripped out) ...
(0.286013 / 22.94MB)      Parse Date Format String Constants
(0.286240 / 22.95MB)      Parse Current Time Variables
(0.286317 / 22.95MB)      Parsing Segment, Embed, and Global Vars Conditionals
(0.286679 / 22.95MB)      Processing Preload Text Replacements: var_message
(0.286726 / 22.95MB)       - Beginning Tag Processing -
(0.286749 / 22.93MB)      Parsing Tags in Template
(0.286804 / 22.94MB)      Tag: {exp:seo_lite entry_id="{exp:stash:get name='entry_id'}" parse="inward"}
(0.286868 / 22.94MB)      No Closing Tag
(0.286921 / 22.94MB)      Tag: {exp:stash:get name='title'}
(0.286975 / 22.95MB)      No Closing Tag
(0.287029 / 22.95MB)      Tag: {exp:stash:get name='og_image'}
(0.287082 / 22.95MB)      No Closing Tag
(0.287138 / 22.95MB)      Tag: {exp:stash:get name='color'}
(0.287189 / 22.95MB)      No Closing Tag
(0.287282 / 22.96MB)      Tag: {exp:structure:nav start_from="/" max_depth="1" status="{exp:stash:get name='status'}" css_id="none" parse="inward"}
(0.287353 / 22.95MB)      No Closing Tag
(0.287409 / 22.96MB)      Tag: {exp:stash:parse process="end"}
(0.287461 / 22.96MB)      Closing Tag Found
(0.287519 / 22.96MB)      Tag: {exp:stash:get name='edit_main_content' scope="user"}
(0.287574 / 22.96MB)      No Closing Tag
(0.287635 / 22.97MB)      Tag: {exp:stash:get name='background_image'}
(0.287683 / 22.96MB)      No Closing Tag
(0.287728 / 22.97MB)      Processing Tags
(0.287755 / 22.97MB)      Module Tag: Seo_lite/
(0.287778 / 22.97MB)      Module Tag: Stash/get
(0.287802 / 22.97MB)      Module Tag: Stash/get
(0.287823 / 22.97MB)      Module Tag: Stash/get
(0.287844 / 22.97MB)      Module Tag: Structure/nav
(0.287865 / 22.97MB)      Module Tag: Stash/parse
(0.287885 / 22.97MB)      Module Tag: Stash/get
(0.287906 / 22.97MB)      Module Tag: Stash/get
(0.287923 / 22.97MB)      Including Files for Plugins and Modules
(0.288793 / 23.07MB)      Files for Plugins and Modules All Included
(0.288811 / 23.07MB)      Beginning Final Tag Data Processing
(0.288826 / 23.07MB)      Calling Class/Method: Seo_lite/
(0.288846 / 23.07MB)      Plugin in Parameter, Processing Plugin First
(0.288924 / 23.09MB) Tag: {exp:stash:get name='entry_id'}
(0.288975 / 23.09MB) No Closing Tag
(0.289025 / 23.09MB) Module Tag: Stash/get
(0.289039 / 23.09MB) Including Files for Plugins and Modules
(0.289050 / 23.09MB) Files for Plugins and Modules All Included
(0.289469 / 23.12MB) Beginning Final Tag Data Processing
(0.289487 / 23.12MB) Calling Class/Method: Stash/get
(0.289567 / 23.12MB) -> Class Called: Stash
(0.289761 / 23.13MB) -> Method Called: get
(0.289823 / 23.13MB) Stash: RETRIEVED entry_id with value 1130
(0.289926 / 23.13MB) -> Data Returned
(0.290139 / 23.08MB)       -> Class Called: Seo_lite
(0.291888 / 23.07MB)       -> Method Called: Seo_lite
(0.291966 / 23.07MB)       -> Data Returned
(0.292002 / 23.07MB)      Calling Class/Method: Stash/get
(0.292075 / 23.07MB)       -> Class Called: Stash
(0.292256 / 23.08MB)       -> Method Called: get
(0.292309 / 23.08MB)      Stash: RETRIEVED title with value Bar
(0.292407 / 23.08MB)       -> Data Returned
(0.292452 / 23.08MB)      Calling Class/Method: Stash/get
(0.292526 / 23.08MB)       -> Class Called: Stash
(0.292705 / 23.08MB)       -> Method Called: get
(0.292760 / 23.08MB)      Stash: RETRIEVED og_image with value {exp:ce_img:pair src="http://www.mydomain.ch/media/bilder/_max_size/bar.jpg" width="250"}{made}{/exp:ce_img:pair}
(0.292861 / 23.08MB)       -> Data Returned
(0.292897 / 23.08MB)      Calling Class/Method: Stash/get
(0.292969 / 23.08MB)       -> Class Called: Stash
(0.293146 / 23.08MB)       -> Method Called: get
(0.293202 / 23.08MB)      Stash: RETRIEVED color with value ...
(0.293301 / 23.08MB)       -> Data Returned
(0.293338 / 23.08MB)      Calling Class/Method: Structure/nav
(0.293358 / 23.08MB)      Plugin in Parameter, Processing Plugin First
(0.293420 / 23.09MB) Tag: {exp:stash:get name='status'}
(0.293476 / 23.10MB) No Closing Tag
(0.293525 / 23.10MB) Module Tag: Stash/get
(0.293539 / 23.10MB) Including Files for Plugins and Modules
(0.293549 / 23.10MB) Files for Plugins and Modules All Included
(0.293933 / 23.12MB) Beginning Final Tag Data Processing
(0.293950 / 23.12MB) Calling Class/Method: Stash/get
(0.294022 / 23.13MB) -> Class Called: Stash
(0.294203 / 23.13MB) -> Method Called: get
(0.294257 / 23.13MB) Stash: RETRIEVED status with value open|Draft
(0.294355 / 23.13MB) -> Data Returned
(0.294572 / 23.08MB)       -> Class Called: Structure
(0.294905 / 23.10MB)       -> Method Called: nav
(0.300818 / 23.22MB)       -> Data Returned
(0.300870 / 23.20MB)      Calling Class/Method: Stash/parse
(0.300980 / 23.20MB)       -> Class Called: Stash
(0.301178 / 23.21MB)       -> Method Called: parse
(0.301216 / 23.21MB)      Stash: this tag will be post-processed on end: {exp:stash:parse process="end"}
(0.301300 / 23.21MB)       -> Data Returned
(0.301337 / 23.21MB)      Calling Class/Method: Stash/get
(0.301410 / 23.21MB)       -> Class Called: Stash
(0.301598 / 23.21MB)       -> Method Called: get
(0.301655 / 23.21MB)      Stash: RETRIEVED edit_main_content with value ...
(0.301753 / 23.21MB)       -> Data Returned
(0.301790 / 23.21MB)      Calling Class/Method: Stash/get
(0.301865 / 23.21MB)       -> Class Called: Stash
(0.302051 / 23.21MB)       -> Method Called: get
(0.302104 / 23.21MB)      Stash: RETRIEVED background_image with value http://www.mydomain.ch/media/hintergrund/_max_size/Lueftungstapete.jpg
(0.302202 / 23.21MB)       -> Data Returned
(0.302270 / 23.18MB)      Parsing Tags in Template
(0.302299 / 23.18MB)      Tag: {exp:ce_img:pair src="http://www.mydomain.ch/media/bilder/_max_size/bar.jpg" width="250"}
(0.302364 / 23.18MB)      Closing Tag Found
(0.302420 / 23.19MB)      Processing Tags
(0.302454 / 23.19MB)      Plugin Tag: Ce_img/pair
(0.302468 / 23.19MB)      Including Files for Plugins and Modules
(0.305107 / 23.56MB)      Files for Plugins and Modules All Included
(0.305124 / 23.56MB)      Beginning Final Tag Data Processing
(0.305139 / 23.56MB)      Calling Class/Method: Ce_img/pair
(0.305243 / 23.56MB)       -> Class Called: Ce_img
(0.305277 / 23.56MB)       -> Method Called: pair
(0.317498 / 25.02MB)        ***  CE Image debug: Base path: '/my_server_path/'
(0.317519 / 25.02MB)        ***  CE Image debug: Source image: 'http://www.mydomain.ch/media/bilder/_max_size/bar.jpg', Fallback image: ''
(0.317531 / 25.02MB)        ***  CE Image debug: The image '/my_server_path/media/bilder/_max_size/bar.jpg' is cached.
(0.317975 / 25.00MB)       -> Data Returned
(0.318039 / 24.99MB)       - End Tag Processing -
(0.318073 / 24.99MB)      Processing Advanced Conditionals
(0.319817 / 24.99MB)      Calling Extension Class/Method: Mo_variables_ext/cleanup
(0.319997 / 24.99MB)      Calling Extension Class/Method: Stash_ext/template_post_parse
(0.320839 / 24.99MB)      Calling Extension Class/Method: Structure_ext/template_post_parse
(0.321312 / 25.00MB) Calling Extension Class/Method: Mo_variables_ext/cleanup
(0.321507 / 25.01MB) Calling Extension Class/Method: Stash_ext/template_post_parse
(0.321763 / 25.02MB) Stash: post-processing tag: {exp:stash:parse process="end"} will be replaced into {6ee64145dfa4ae5926a9c326266d59541297750798}
(0.321843 / 25.02MB) Stash: processing inner tags
(0.322131 / 25.02MB) Calling Extension Class/Method: Stash_ext/template_fetch_template
(0.322576 / 25.02MB) Tag: {exp:stash:get name='main_content'}
(0.322635 / 25.02MB) No Closing Tag
(0.322699 / 25.02MB) Module Tag: Stash/get
(0.322713 / 25.02MB) Including Files for Plugins and Modules
(0.322725 / 25.02MB) Files for Plugins and Modules All Included
(0.323373 / 25.05MB) Beginning Final Tag Data Processing
(0.323391 / 25.05MB) Calling Class/Method: Stash/get
(0.323486 / 25.05MB) -> Class Called: Stash
(0.323684 / 25.06MB) -> Method Called: get
(0.323752 / 25.06MB) Stash: RETRIEVED main_content with value <article class="content_block"> <h1>Trinken im Kairo</h1> <p>{bild_2}</p> <p>...</p>
(0.323861 / 25.06MB) -> Data Returned
(0.323967 / 25.02MB) Stash: processing inner tags
(0.324455 / 25.03MB) Tag: {exp:ce_img:pair src='http://www.mydomain.ch/media/bilder/_max_size/_ULI_Kairo_02.JPG' width='1200' height='800'}
(0.324522 / 25.03MB) Closing Tag Found
(0.324570 / 25.03MB) Tag: {exp:switchee variable="full" parse="inward"}
(0.324624 / 25.04MB) Closing Tag Found
(0.324690 / 25.04MB) Plugin Tag: Ce_img/pair
(0.324716 / 25.04MB) Plugin Tag: Switchee/
(0.324730 / 25.04MB) Including Files for Plugins and Modules
(0.325425 / 25.11MB) Files for Plugins and Modules All Included
(0.325466 / 25.11MB) Beginning Final Tag Data Processing
(0.325481 / 25.11MB) Calling Class/Method: Ce_img/pair
(0.325583 / 25.11MB) -> Class Called: Ce_img
(0.325610 / 25.11MB) -> Method Called: pair
(0.327154 / 25.14MB)   ***  CE Image debug: Base path: '/my_server_path/'
(0.327168 / 25.14MB)   ***  CE Image debug: Source image: 'http://www.mydomain.ch/media/bilder/_max_size/_ULI_Kairo_02.JPG', Fallback image: ''
(0.327178 / 25.14MB)   ***  CE Image debug: The image '/my_server_path/images/made/media/bilder/_max_size/_ULI_Kairo_02_1200_800.JPG' is cached.
(0.327765 / 25.13MB) -> Data Returned
(0.327791 / 25.13MB) Calling Class/Method: Switchee/
(0.328271 / 25.13MB) -> Class Called: Switchee
(0.328831 / 25.13MB) -> Method Called: Switchee
(0.328908 / 25.13MB) -> Data Returned
(0.329007 / 25.09MB) Stash: processing inner tags
(0.329551 / 25.10MB) Tag: {exp:ce_img:pair src="http://www.mydomain.ch/media/bilder/_max_size/_ULI_Kairo_02.JPG" width="600" allow_scale_larger="yes"}
(0.329617 / 25.10MB) Closing Tag Found
(0.329677 / 25.11MB) Plugin Tag: Ce_img/pair
(0.329691 / 25.11MB) Including Files for Plugins and Modules
(0.329702 / 25.11MB) Files for Plugins and Modules All Included
(0.329733 / 25.11MB) Beginning Final Tag Data Processing
(0.329746 / 25.11MB) Calling Class/Method: Ce_img/pair
(0.329863 / 25.11MB) -> Class Called: Ce_img
(0.329888 / 25.11MB) -> Method Called: pair
(0.331330 / 25.14MB)   ***  CE Image debug: Base path: '/my_server_path/'
(0.331343 / 25.14MB)   ***  CE Image debug: Source image: 'http://www.mydomain.ch/media/bilder/_max_size/_ULI_Kairo_02.JPG', Fallback image: ''
(0.331352 / 25.14MB)   ***  CE Image debug: The image '/my_server_path/images/made/media/bilder/_max_size/_ULI_Kairo_02_600_400_s.JPG' is cached.
(0.331856 / 25.12MB) -> Data Returned
(0.332686 / 25.10MB) Calling Extension Class/Method: Mo_variables_ext/cleanup
(0.332865 / 25.10MB) Calling Extension Class/Method: Stash_ext/template_post_parse
(0.333805 / 25.11MB) Calling Extension Class/Method: Structure_ext/template_post_parse
(0.334644 / 25.09MB) Calling Extension Class/Method: Structure_ext/template_post_parse
(0.334842 / 25.07MB) - End Template Processing -
(0.334855 / 25.07MB) Parse Global Variables
(0.338096 / 25.08MB) Template Parsing Finished
Memory Usage: 27,221,456 bytes

one thing I've learned here is that the wrapper template should absolutely contain NO EMBEDS!

Initially I had 2 embeds within the wrapper template and this was slowing down performance!

still: if anybody knows anything on how to even speed up things, you're very much welcome with your suggestions!

mark: thanks for being so helpful already!

0

I'm not sure it explains the .5 second load time difference, but while you are trying to save the main content variable you are actually replacing the variable on every page view:

{exp:stash:set scope="site" parse_tags='yes' parse_conditionals='yes' save='yes' refresh='60'}

If you add the replace="no" parameter then the cache won't be rebuilt with every page view. Instead, it will only be rebuilt after the refresh="x" period specified.

{exp:stash:set scope="site" parse_tags="yes" parse_conditionals="yes" save="yes" refresh='60' replace="no"}

That will help get the queries down, however the longer processing time is most likely some kind of recursion. My guess is nsm_transplant might be in conflict with Stash in some way.

4
  • hi mark, thanks a lot for the explanation! I've followed your advice and put the replace="no" parameter. but that didn't trigger what you've expected. the queries remain exactly the same, but the load time has decreased to 0.5s. that's kind of odd. I also suspected that nsm_transplant was the culprit to the long loading times. that's why I opened another thread asking you on how to replace that with stash. but I haven't figured it out that yet. I think, because the channel entry loop get's executed on every page load, the queries remain the same? is there another way to decrease the queries? – outline4 Feb 12 '13 at 10:20
  • I've tried set_list around the channel:entries loop and get_list within the wrapper template, but somehow I coudn't get it to work... – outline4 Feb 12 '13 at 10:21
  • in fact, the loading time went to 0.5s because it would display the same content on every page. I had to put in some context and now it works, although the speed and queries remain the same as in the beginning. hm? – outline4 Feb 12 '13 at 11:50
  • so I've updated my templates here: expressionengine.stackexchange.com/questions/6120/… witout the need of nsm_transplant and must say that it works quite well, but still about 1s instead of the 0.5 seconds I wish to get... maybe I have to revise some parts of it and figure out a caching method... – outline4 Feb 12 '13 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.