View Full Version : Templates: why cache?
rawaccess
08-21-2005, 10:22 PM
hello.
i made changes to a tpl file, then uploaded it to my server replacing the existing file of the same name, but the change was not taking effect.
when i deleted a template file, whatever it did no longer showed. so, i created a dummy file on the server and named it after one of the temple files. this dummy file is 1bit in size and contains nearly no data, but the templete file still had the same old effect on the webpage display.
obviously, the template files are cached somewhere. i deleted the contents of /temp/template/ in order to remove the websites "memory.".
now all i get is a white page for my website.
why is there this cache?
*edit* i modified the title and the last question from "how to modify" and "how do we modify templates" respectivly.
this change occured because i learned my real problem was being not aware of the cache.
vkaryl
08-21-2005, 10:27 PM
Well, I've been just treating them like plain .html or .php files. Dodge the Smarty templating stuff within them, and change the html and css specific entities. Unless I'm misunderstanding you?
rawaccess
08-21-2005, 10:35 PM
my site was displaying only a white page. i viewed the index source and saw that it contained the dummy file even though i uploaded and replaced it already with the proper phpld index file. i went back to /temp/template/ and deleted a random file out of six. now my site shows properly with the changes i made.
so, here is a new question: why does phpld cache the templates?
kickass
08-21-2005, 11:10 PM
Though I could be misunderstanding- why wouldn't the template be cached? It saves time loading. And I can't say I've ever had a problem when making and previewing changes with uploading a file and hitting the reload/refresh button to see the change in the browser . . . why would you want the page to load fresh every time? Your visitors sure would not be happy with that if they're on a dialup connection. Actually, if you use IE you can change a setting in that browser and it will do what you want and not cache anything, yet not ruin the experience for your surfers.
I've never touched anything in /temp/template -- why would you need to?
Is there something I'm missing here? Casey? David?
rawaccess
08-21-2005, 11:28 PM
the only thing ur missing is something that i have not stated.
when i refresh the new changes are not shown. this is happening on two computers, one with both IE and firefox and the other with IE.
i use f5 and the fresh button.
so far i have made six changes and had to delete the contents of the temp/template folder five times.
vkaryl
08-21-2005, 11:36 PM
Gosh, that's just plain weird. Have you tried with CTRL-F5 too? In FF I'm able to see changes by just clicking on the reload icon, but you might try that hard-refresh.... and in FF you might also try using Tools/Options/Privacy/and click on the Clear button under Cache....
David
08-22-2005, 12:19 AM
With templates, it first checks to see if changes have been made:
If no, then load the cache.
If yes, then run the php code and output the new page.
I don't know where to find it, but there shoudl be somewhere in the code to turn off cacheing. You might try the old CTRL-F.
Ap0s7le
08-22-2005, 01:21 AM
I really wouldn't shut off caching.
It will slow down the user experience, but not only that. It will cause your server to work harder than needed.
I have another man who has issues like this, turns out it's his cache. As in local on the computer. Try clearing it out, and posting the URL to the directory in question and I'll have a look.
Feel free to PM me the FTP details and I'll have a closer look so see if anything is wrong. You might even try upgrading to the current version which will be posted shortly RC5.2
Let me know :)
-Casey
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.