[ NetworkAdmin @ 27.08.2004. 12:34 ] @
Jeli neko radio multiple Cache na jednoj stranici da radi recimo centralna kolona sajta se kesira 30 sekundi a header i footer po sat vremena? |
[ NetworkAdmin @ 27.08.2004. 12:34 ] @
[ bluesman @ 27.08.2004. 23:49 ] @
Nista te ne razumem.
[ BlueIce @ 28.08.2004. 07:31 ] @
Ja sam, i sasvim je moguća takva kombinacija, nešto slično sam radio, više različitih "sekcija" jedne stranice se keširaju različitim vremenima i to radi kao zmaj. Čak možeš da dodeliš grupe pa tek onda imaš interesantne efekte...
PS: Mislim da bi Vas dvojica trebali još malo da pročitate Smaty DOC B-) [ NetworkAdmin @ 28.08.2004. 10:16 ] @
BlueIce imas pravo, ma i meni je bilo logicno skroz da imaju takve mogucnosti samo do sad mi nisu trebale.
Sad sam sredio recimo banner $chache_lifetime je 30 sekundi meni i ostale zezancije sam stavio 24 sata a vijesti prilikom dodavanja nove vijesti ili komentara na vijest cistim cache i naravno profilaktike radi svakih 30 minuta. Ma sve se nadje samo treba potreba da bi se naucilo. Mali hint pogledajte varivablu $caching i notice ako je ona 2. [ NetworkAdmin @ 28.08.2004. 10:30 ] @
Evo sto kazu na smarty general mailing listi
Citat: As far as I'm aware, it's not possible to change the caching values for children of the parent templates. The output is cached for a display()/fetch() call and all its descendants. Theres no reason why you have to only have the one template and include everything in from there.. you can do it like this: Code: <?php $smarty->cache_lifetime = 10000; $smarty->display('header.tpl'); $smarty->cache_lifetime = 30; $smarty->display('banner.tpl'); $smarty->cache_lifetime = 1800 + $randomness; $smarty->display('content.tpl'); $smarty->cache_lifetime = 10000; $smarty->display('footer.tpl'); ?> I do all my pages like this for the fine tuning it allows. [ BlueIce @ 28.08.2004. 15:21 ] @
Mislim da to i nije tako pametna ideja, tj mnogo je po meni bolje:
Code: <?php // Pretpostavljamo da su vremena sa kesiranje dobro postavljena if ($updated_1) clear_cache('group_1'); //ociti kes, vrati vreme na ono koje treba da bude za kesiranje (ako se promenilo), a smarty ce da zavrsi ostalo :) if ($updated_2) clear_cache('group_2'); . . . if ($updated_n) clear_cache('group_n'); $smaty->assign('header', $smarty->fetch('header.tpl') ); $smaty->assign('banner', $smarty->fetch('banner.tpl') ); $smaty->assign('footer', $smarty->fetch('footer.tpl') ); $smarty->display('content.tpl'); ?> [ NetworkAdmin @ 29.08.2004. 01:29 ] @
ma ovo je copy paste sa mail liste bilo... naravno da i ja fetchujem komade sajta prvo pa ih kao stringove samo assign...
Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|