Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Several refreshes to show new template

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
leuchtdiode
Smarty n00b


Joined: 26 Jan 2012
Posts: 4

PostPosted: Thu Jan 26, 2012 9:14 am    Post subject: Several refreshes to show new template Reply with quote

hi guys,

we got a weird problem. i think - but i don't know exactly - since we made an update to 3.1.5, we got the problem that we have to refresh the website at least two times to see the changes in the smarty template.

example:

i create the smarty template "test.tpl" and write "hello". when i go to the site, the template will be compiled and write "hello" to the website. when i go back to the created template "test.tpl", change "hello" to "hellooo", refresh the website, i still get the message "hello". when i wait 2 or 3 seconds and refresh the website again, i get "hellooo". when i change something in the template and refresh immediately (no wait of 2 or 3 seconds), i often need 3 refreshes.

it seems that it needs some time to refresh the template. but it's very weird, because i see that smarty changes the template-compile, but show me the old version on the website.

does anyone of you have an idea what could cause this problem?

thx & regards,
alex
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5067
Location: Hamburg / Germany

PostPosted: Thu Jan 26, 2012 4:14 pm    Post subject: Reply with quote

Looks to me like a problem with either the browser cache, or if you used PHP caching like ACP that it is not configured crrectly.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7365
Location: Lincoln Nebraska, USA

PostPosted: Thu Jan 26, 2012 5:12 pm    Post subject: Reply with quote

could also be NFS cache if you are using that on your file system.
Back to top
View user's profile Send private message Visit poster's website
leuchtdiode
Smarty n00b


Joined: 26 Jan 2012
Posts: 4

PostPosted: Fri Jan 27, 2012 8:54 am    Post subject: Reply with quote

U.Tews wrote:
Looks to me like a problem with either the browser cache, or if you used PHP caching like ACP that it is not configured crrectly.


because of the fact that we use zend server, we have to check this.

mohrt wrote:
could also be NFS cache if you are using that on your file system.


the compiles are not loaded through NFS, they are loaded from the machine's file system.

but we only have the problem with the smarty-files. when we change a PHP-file, a CSS-file or whatever, we have no problems. we also use - in a few applications - an own template-class which we wrote a few years ago. this class also uses .tpl-files. we neither got problem with "severales refreshes" with this class. it is curiously only with smarty.

thx for ur help & best regards,
alex
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5067
Location: Hamburg / Germany

PostPosted: Fri Jan 27, 2012 1:04 pm    Post subject: Reply with quote

I suspect the caching of the server. After a template gets recompiled Smarty does 'include' the new PHP files.

Try to disable the server cache for a test.
Back to top
View user's profile Send private message
leuchtdiode
Smarty n00b


Joined: 26 Jan 2012
Posts: 4

PostPosted: Thu Feb 02, 2012 1:40 pm    Post subject: Reply with quote

U.Tews wrote:
I suspect the caching of the server. After a template gets recompiled Smarty does 'include' the new PHP files.

Try to disable the server cache for a test.


we tested a little bit and you were right. we think it depends on the ZendOptimizer+

unfortunately we cannot turn off this directive, because zend won't work at all...

but when i set the cache-time to 10 seconds, it really needs 10 seconds (unnecessary how much refreshes i do) to show the new template.

but it seems to me, that he only caches smarty-templates. why does the server doesn't cache normal PHP-files? we never got problems with these. do you have any idea?

thx & regards,
alex
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5067
Location: Hamburg / Germany

PostPosted: Thu Feb 02, 2012 2:59 pm    Post subject: Reply with quote

What is your setting of

$smarty->compile_check

and

$smarty->caching ?
Back to top
View user's profile Send private message
leuchtdiode
Smarty n00b


Joined: 26 Jan 2012
Posts: 4

PostPosted: Fri Feb 03, 2012 2:16 pm    Post subject: Reply with quote

U.Tews wrote:
What is your setting of

$smarty->compile_check

and

$smarty->caching ?


$smarty->compile_check = true;

if i set the value to "false", i don't get the new template even after serveral refreshes...

$smarty->caching is default, so false.

i still try to disable zend optimizer+, but the whole website crashes when i turn it off. so i can't exclude this component as the problem.

furthermore, it is not only affecting .tpl-files, .phtml-files which are handled by smarty, also got problems...

EDIT: i disabled zend optimizer+ now and got a test-website to run. turned out that zend optimizer+ causes the problem. when i deactive the module, the template refreshes immediately. any idea what we can change in the zend-ini to get both together work?

regards,
alex
Back to top
View user's profile Send private message
Goggles
Smarty n00b


Joined: 16 Feb 2016
Posts: 1

PostPosted: Wed Feb 17, 2016 11:56 am    Post subject: Reply with quote

U.Tews wrote:
Looks to me like a problem with either the browser cache, or if you used PHP caching like ACP that it is not configured crrectly.


Finally fixed this after reading your post by disabling browser cache. What a pain in the butt lol. Thanks for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP