caching / insert question
| From: | Steve | Date: | Sat, 16 Feb 2002 03:08:41 +0000 |
| Subject: | caching / insert question | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2689@lists.php.net to get a copy of this message | ||
I installed the 02152002 snapshot today - no problems that I can tell.
I then turned on caching and it works!
I soon realized I was caching all my dynamic content.
I use url's like:
http://192.168.10.70/index.php?page=info&id=628
The page variable is used to determine what .php and .tpl files are used for
the center of the page and the id is used by info.php to look up a database
record.
With caching on, the URL string is now ignored after index.php.
I guess this is where the insert() function comes in. I tried writing one
as described in the docs. The problem I see here is now I am having to put
html in the insert function in order to control the dynamic content and
prevent it from being cached to disk.
I assume my problem is I don't understand the programming ideology behind
this behavior. I love Smarty because I have ZERO layout code in my logic/db
code. This looks like if I want to use the caching features, I would have
to put html in the logic. I guess the other option is to not use the
caching.
I'm using phpa, and now using the output buffering (I think it is working ok
with Smarty). I just want to use all the "easy" performance enhancements I
can.
Please advise, if I'm missing something on the cachning/insert() mechanism.
Steve