|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.web.servlet.HttpResponseHeaders
public class HttpResponseHeaders
Utility methods for setting headers on the HTTP response.
Method Summary | |
---|---|
static void |
cachePrivatelyForAboutOneYear(javax.servlet.http.HttpServletResponse response)
Sets the Cache-control and Expires headers to allow browsers, but not
proxies, to cache the response for up to approximately 1 year. |
static void |
cachePubliclyForAboutOneYear(javax.servlet.http.HttpServletResponse response)
Sets the Cache-control and Expires headers to allow browsers and proxies
to cache the response for up to approximately 1 year. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void cachePrivatelyForAboutOneYear(javax.servlet.http.HttpServletResponse response)
Cache-control
and Expires
headers to allow browsers, but not
proxies, to cache the response for up to approximately 1 year. This kind of caching is appropriate for non-public
content such as avatars, attachments, thumbnails, etc. More specifically, this sets the following headers:
TheCache-control
:Expires
: Wed, 31 Dec 1969 23:59:59 GMT
Expires
header is set to a date in the past to prevent HTTP 1.0 proxies from caching what is non
publicly-accessible content. Since the Cache-control
header takes precendence over the
Expires
header, HTTP 1.1-capable proxies will still cache the data privately.
If the response already has a Cache-control
header, it will be overwritten.
response
- the HttpServletResponse on which we will set the headerpublic static void cachePubliclyForAboutOneYear(javax.servlet.http.HttpServletResponse response)
Cache-control
and Expires
headers to allow browsers and proxies
to cache the response for up to approximately 1 year. This kind of caching is appropriate for public content such
as icons, sprites, etc.
If the response already has aCache-control
:Expires
: "now" + 1 year
Cache-control
header, it will be overwritten.
response
- the HttpServletResponse on which we will set the header
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |