I stumbled upon the following: I have a variable that is assigned in php with nocache set to true. But sometimes the variable does not get assigned at all. So I use the default modifier in the template for cases where the variable is not assigned. Caching is enabled.
Now when the template gets compiled while the variable is not assigned the compiler does not know about the nocache and thus probably caches the default value. When the page gets rendered again with the variable set (and nocache set to true), it still gets ignored. I suspect the reason is that the default value got cached during the compile step.
So I'd be happy if you could change this in a way that default values never get cached. The downside would be that also variables where the default is really cacheable would not get cached as well so I can understand why you would not want this. In that case I'd be happy if you could consider the following ideas:
Warn in the documentation you should not use default for variables that have nocache set
Warn during the compile step if the default modifier is present (but not applied) for a variable which has nocache set
Implement a nocache modifier or a default_nocache modifier
Also I could just avoid using default for variables with nocache set or try using the nocache tag everywhere I use default. But that would not help anyone who stumples over the same thing and wonders what is going on.
Hi,
I stumbled upon the following: I have a variable that is assigned in php with nocache set to true. But sometimes the variable does not get assigned at all. So I use the default modifier in the template for cases where the variable is not assigned. Caching is enabled.
Now when the template gets compiled while the variable is not assigned the compiler does not know about the nocache and thus probably caches the default value. When the page gets rendered again with the variable set (and nocache set to true), it still gets ignored. I suspect the reason is that the default value got cached during the compile step.
So I'd be happy if you could change this in a way that default values never get cached. The downside would be that also variables where the default is really cacheable would not get cached as well so I can understand why you would not want this. In that case I'd be happy if you could consider the following ideas:
Also I could just avoid using default for variables with nocache set or try using the nocache tag everywhere I use default. But that would not help anyone who stumples over the same thing and wonders what is going on.
Thanks Michael