Pregunta

What makes smarty decide if the cache it has is sufficient or if it needs to recreate it? Will the $_REQUEST do? Or all globals including cookies, session and etc... Is index.php and index.php?task=home have the same cache, what about cookies and session info? How does it work? I have a site that I want to cache to the maximum potential but I don't even know how the cache works and they don't explain the internals on the smarty website.

Answer To Rodney that might be helpful in understanding my question: I'm interested in knowing if smarty turns dynamic code into static html as in: smarty.net/docs/en/language.function.nocache.tpl and if so when and how does it decide that the cache is good or bad. so if I had Hello {$user->username}! would it show the Hello Rodney To Brad because it cached it when brad was looking at the page?

¿Fue útil?

Solución

read the docs on Caching.

Smarty decides to re-execute a template if a cache cannot be found, or has exceeded its lifetime. $cache_id is a value one passes smarty to make it save the cache specifically for $cache_id

UPDATE

The section Controlling Cacheability of Output explains how smarty can handle dynamic content within static caches. That page answers your question regarding "Rodney" and "Brad" being dynamic values injected into the cached rendering of the template.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top