0

I want to set this expiration for weblogic, here is the description:

http://developer.yahoo.com/performance/rules.html#expires

http://code.google.com/speed/page-speed/docs/caching.html

I see a lot of examples how to do it in Apache using .htaccess file but I don't see examples for weblogic.

Can someone please provide an example how to set expiration of static content far in advance?

Roman Goyenko
  • 6,965
  • 5
  • 48
  • 81

1 Answers1

2

Weblogic does not have a config file to do this. You'll have to do this in your JSP code (all of them using Pragma HTTP Headers) or using a Filter for all static files such as CSS and images.

There is a good example in BalusC's answer to this question

Add an Expires or a Cache-Control header in JSP

Specifically

httpResponse.setDateHeader("Expires", System.currentTimeMillis() + 604800000L); // 1 week in future.
Community
  • 1
  • 1
JoseK
  • 31,141
  • 14
  • 104
  • 131
  • JSP won't work because I need to refresh the JSP every time, but I import some static content in the JSPs and want to cache that content - images, css, javascript. I guess I'll need to write a filter then. – Roman Goyenko Nov 16 '11 at 16:16