CMS MADE SIMPLE FORGE

CMS Made Simple Core

 

[#8918] Smarty block plugin won't be cached

avatar
Created By: (pmw)
Date Submitted: Fri Feb 08 05:44:21 -0500 2013

Assigned To:
Version: 1,11,4
CMSMS Version: None
Severity: Minor
Resolution: Invalid
State: Closed
Summary:
Smarty block plugin won't be cached
Detailed Description:
CMSms 1.11.4 doesn't cache Smarty block plugins.

How to reproduce:

1. Create "block.sample.php" in "plugins":
<?php
function smarty_block_sample($params, $content)
{
	if (isset($content)) {
		return "Hello " . rand() . "!";
	}
}
?>

2. Include "{sample}xyz{/sample}" on a page

3. Make sure that "Enable Smarty Caching" is on "Yes" and caching is enabled for
the tested page

4. Open the page multiple times and the plugin will generate always a new random
number (so it was not cached)


History

Comments
avatar
Date: 2013-02-08 06:01
Posted By: Tapio Löytty (Stikki)

Hi,

{content} is compiler. Therefore it's never cached and always executed.

So anything inside is not cached.

-Stikki-
      
avatar
Date: 2013-02-08 06:28
Posted By:  (pmw)

Originally I post my problem in the forum
(http://forum.cmsmadesimple.org/viewtopic.php?f=6&t=61378). There I got the
information that CMSms 1.11 can cache it. Therefor I decided to submit this as a
bug.

I use GeSHi for source code formatting. Unfortunately GeSHi is very slow, so I
need caching. Is there any workaround? Currently I'm using CMSms 1.10 with
custom changes in the source code to cache my block plugins. But this makes
upgardes very difficult.
      
avatar
Date: 2013-03-08 22:09
Posted By: Robert Campbell (calguy1000)

{content} blocks specifically disable caching.  We will investigate changing
this for 2.0.
      
avatar
Date: 2017-07-09 18:49
Posted By: Robert Campbell (calguy1000)

By default smarty plugins are not cached.
CMSMS extends this behavior to allow functions named smarty_cms_xxxx_yyyy(....);
to be cached.
      
Updates

Updated: 2017-07-09 18:49
resolution_id: 5 => 9
cmsms_version_id: 29887 => -1
state: Open => Closed

Updated: 2013-02-08 06:01
resolution_id: => 5