View previous topic :: View next topic |
Author |
Message |
leuchtdiode Smarty n00b
Joined: 26 Jan 2012 Posts: 4
|
Posted: Thu Jan 26, 2012 9:14 am Post subject: Several refreshes to show new template |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Jan 26, 2012 4:14 pm Post subject: |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Jan 26, 2012 5:12 pm Post subject: |
|
|
could also be NFS cache if you are using that on your file system. |
|
Back to top |
|
leuchtdiode Smarty n00b
Joined: 26 Jan 2012 Posts: 4
|
Posted: Fri Jan 27, 2012 8:54 am Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Jan 27, 2012 1:04 pm Post subject: |
|
|
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 |
|
leuchtdiode Smarty n00b
Joined: 26 Jan 2012 Posts: 4
|
Posted: Thu Feb 02, 2012 1:40 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Feb 02, 2012 2:59 pm Post subject: |
|
|
What is your setting of
$smarty->compile_check
and
$smarty->caching ? |
|
Back to top |
|
leuchtdiode Smarty n00b
Joined: 26 Jan 2012 Posts: 4
|
Posted: Fri Feb 03, 2012 2:16 pm Post subject: |
|
|
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 |
|
Goggles Smarty n00b
Joined: 16 Feb 2016 Posts: 1
|
Posted: Wed Feb 17, 2016 11:56 am Post subject: |
|
|
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 |
|
|