2013/11/25 Christopher Schultz <ch...@christopherschultz.net>: > On 11/25/13, 10:27 AM, David Balažic wrote: >> Hi! >> >> Considering that JSP pages are by definition dynamic (different on >> each GET), why doesn't Tomcat set the HTTP headers in the line of >> "do not cache this, it's dynamic!" by default for all generated >> HTML (*.jsp files and servlet responses)? > > What about JSPs that produce (relatively) static stuff? Would you want > Tomcat to tell the client to re-fetch that data every time? (Then we'd > get questions about why Tomcat was doing that, of course.) >
+1 Even if content is dynamic, there might be different caching strategies. The caching interval may be different, such as several minutes, 1 hour, 1 day or several months. Tomcat sets headers that prevent caching for the content that is protected by security constraints. The rest is up to you. > It's trivial for you to add such headers yourself, and this is a > decision best made by application authors and not the container. So, > go ahead and exercise your right to determine how your own web > application behaves and set those headers yourself. Don't want to edit > all your JSPs? How about slapping a Filter in front of them instead? > http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Expires_Filter Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org