Roman Goyenko
Roman Goyenko

Reputation: 7080

Set HTTP Caching Expiration, Recommended by Google PageSpeed and Yahoo for weblogic

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?

Upvotes: 0

Views: 2504

Answers (1)

JoseK
JoseK

Reputation: 31371

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.

Upvotes: 2

Related Questions