Turn Off Cache Of Perticular Tpl

Hello ,

I want to stop cache of a particular tpl file , can anyone suggest me how can stop that caching.

problem : i was created a popup that hold dynamic value . so its works for first time , as cache created it not shows change value . when we go to congiq.local & disable_block_cache = true then its works .

so please suggest me alternative way to achieve this issue .

i hope i will get a answer :)

Caching is probably not your problem. If you are properly passing the smarty variables to the template, it is only the template structure that is cached, not the values. If you are using a block then you might have issues depending on how you've setup the block. But just a normal template should utilize the smarty values passed from the controller.

For example, to disable cache for the blocks with Smarty support, please open the app/schemas/block_manager/blocks.php file and replace:

'smarty_block' => array(        
        'content' => array(
            'content' => array(
                'type' => 'simple_text',
                'required' => true,
            )
        ),
        'templates' => 'blocks/smarty_block.tpl',
        'wrappers' => 'blocks/wrappers',
        'multilanguage' => true,
        'cache' => true
    ),

with

'smarty_block' => array(        
       'content' => array(
            'content' => array(
                'type' => 'simple_text',
                'required' => true,
            )
        ),
        'templates' => 'blocks/smarty_block.tpl',
        'wrappers' => 'blocks/wrappers',
        'multilanguage' => true,
        'cache' => false
    ),

thanks all.

Caching is probably not your problem. If you are properly passing the smarty variables to the template, it is only the template structure that is cached, not the values. If you are using a block then you might have issues depending on how you've setup the block. But just a normal template should utilize the smarty values passed from the controller.

you just go in in my_changes, open func.php & write.

function test_time()

{

return TIME;

}

& call this function in products/qty.post.tpl (tpl hook)

{assign var=my_test value=test_time()}

{fn_print_r(my_test)}

you will get first time refresh(after cache clear) timestamp at each refresh. please try it & suggest me a solution .

For example, to disable cache for the blocks with Smarty support, please open the app/schemas/block_manager/blocks.php file and replace:

'smarty_block' => array(
'content' => array(
'content' => array(
'type' => 'simple_text',
'required' => true,
)
),
'templates' => 'blocks/smarty_block.tpl',
'wrappers' => 'blocks/wrappers',
'multilanguage' => true,
'cache' => true
),

with

'smarty_block' => array(
'content' => array(
'content' => array(
'type' => 'simple_text',
'required' => true,
)
),
'templates' => 'blocks/smarty_block.tpl',
'wrappers' => 'blocks/wrappers',
'multilanguage' => true,
'cache' => false
),

Thanks Ecom . i read it at this link http://forum.cs-cart.com/topic/40766-disable-cache-for-certain-blocks-or-parts/ but i thing its for work block cache . but in my issue here is a simple tpl file . I expained replication of issue please read that & provide me a solution.

it will be a great help for me.\

I'm not getting answer . No one here to help .

:-(

No Answer ....

Please get this demo installer & give a solution.

{nocache}{/nocache} also not working .

But if you're using smarty variables for the content (rather than just rewriting data to a file/template) then cache or no-cache will still resolve those variables. The variable values are NOT cached, only the template code itself.

Can you explain in more detail what you pop-up contains that you need it to not be cached?

Thanks tbirnseth

At least you are intrested in my issue . please get attached zip(my problem.zip) in above thread. you install it & when you will check product detail page , there i/m printion only current timestamp . timesatmp value cached not pick dynamic value each time

At least you are intrested in my issue . please get attached zip(my problem.zip) in above thread. you install it & when you will check product detail page , there i/m printion only current timestamp . timesatmp value cached not pick dynamic value each time

We can help you. But this work will take time. We can examine it on the paid basis, if you are interested. I think, Tony will agree with me

Thanks Ecom,

but i'm not interested to pay, we really you think this is issue & you are interested then join me else leave me . :)

Sorry, but I can't invest in setting up a site to install something from someone I know nothing about to evaluate a problem that can't seem to be articulated.

If you can provide a test version of your template (small amount of code that demonstrates the problem you're having), I'm happy to review and give feedback.

If you're not able to either articulate the problem in text or provide a small example, I'm not able to help you either. I explained that if variables of non-cached data are used within your template/block that those real-time template variables will be used to alter the data within your template.

Remember, that many of us contribute our time here. We also run businesses that are based on consulting/development/troubleshooting. We're generally happy to help and Ecom is usually willing to go deeper than I in helping people. So I think your comment to them was quite rude and uncalled for.

Hello tbirnseth

thanks .

Product.post.php in my changes

if($mode == 'view')
{
	Registry::get('view')->assign('my_test_time',TIME);
}

Tpl hook : in my changes (qty.post.tpl)

{nocache}{$my_test_time}{/nocache}

Outout : 1458211312 (first load)

1458211312 (same , but it shuld be dynamic)

its load from cache every time so how can get dynamic value. each time (how to skip cache of perticaular file)

Remember, that many of us contribute our time here. We also run businesses that are based on consulting/development/troubleshooting. We're generally happy to help and Ecom is usually willing to go deeper than I in helping people. So I think your comment to them was quite rude and uncalled for.

yes i know Ecom works very well here & each time i'm appreciating that effort but my friend this is knowledge base forum , where everyone want to share issue & finding a solution , This is not a business place . So please you all of doing well & keep it . But please don't convert this knowledge-base in to business center.

& again really i'm appreciate the effort of all ,who really want to do help .

Hello, I am also facing the same problem.

I have this tpl hook ---> product_multicolumns_list.pre.tpl

There I have this code

{nocache}
{if $product && $product.product_id}
{$ribbon = get_products_promo_ribbon($product.product_id)}
{/if}

{if $ribbon && $image_data && $ribbon.is_visible == “Y” && strpos($image_data.absolute_path, “detailed”) && !strpos($image_data.absolute_path, “thumbnails”) && $image_data.width > $ribbon.container_width}



{$ribbon.ribbon_label}


{/if}
{/nocache}

This will add a ribbon on the top left corner of a product image. When i have automatic cache rebuild enabled its working as intended. But I turn it off the ribbon is shown even if $ribbon.is_visible == "N" which is obviously wrong. You can turn this var to Y and N from the backend control panel of the addon i m developing.

Is there a way to exclude this tpl from the cache (nocache is not working), or am I doing something wrong here?