[opencms-dev] Cache problem with cms:include

Achim Westermann achim.westermann at gmx.de
Sat Jul 6 19:44:55 CEST 2013


Hi Tobias,



> What about the attribute "cacheable" of the cms:include-Tag?
> 
> So far we used cms:include to include parts of a page which mustn't be 
> cached... worked very well with 7.5.4.
> 
> If this isn't working any more it's preferable to use static includes, 
> because they're much more faster.
> 
There is nothing about cache "not working any more". That part of
OpenCms is pretty deep-down, stable and untouched. I am not writing that
from my current knowledge but from my experience with OpenCms. But my
"feeling" tells me that this issue is worthwhile to dig deeper why
something in your webapp did work and now does not. As opposed to say
"It worked in 7.5.4, in 8 it does not. So the latest version has issues."

Static includes are not faster if you want to use caching. Those will
not make use of any caching at all but be included in the jsp
compilation phase. Think of a jsp that performs heavy database
operations being included statically: That code will get executed for
every call.
OK, static includes are faster, if you do not want to cache at all. But
do you want that? You can even set the OpenCms cache to have a timeout
in minutes. Pretty mighty. It is worth spending some time on the OpenCms
cache setting.  Cache is king. Dropping caching may only work if you buy
faster hardware. And may always be compromised by the intensity of DOS
attacks.

> Or what to do to exclude parts of a page from caching?

Set property cache to "never" on a jsp. And then be flexible to decide
to cache the output of that jsp later on properly.

cheers,
Achim



More information about the opencms-dev mailing list