• Post Reply Bookmark Topic Watch Topic
  • New Topic

Caching in Tomcat 8  RSS feed

 
Alex Lemmy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tell me please. How to enable caching of files for tomcat 8? Faced the fact that the site is long loaded - squeezed css, js. It became easier, but Google advised to enable browser caching. I do not know how to do this on tomcat 8.

Thank you.
 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Alex!

Tomcat does no caching - note that the advice was to enable browser caching. That is done in your HTML by writing the standard HTML cache headers as part of your output response stream.

There is one catch, however. Tomcat will remove cache-control headers from the output that is sent back if you are using secure transport (https). That is a security precaution to ensure that a previous request cannot plant a security "time bomb" in cached data that could exploit output of some other secured request.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!