Alexander Wels has posted comments on this change.
Change subject: userportal: Added caching to user portal page webadmin: Added
caching to webadmin page
......................................................................
Patch Set 1: (4 inline comments)
....................................................
File
frontend/webadmin/modules/frontend-overlay/src/main/java/org/ovirt/engine/ui/frontend/server/gwt/CachingFilter.java
Line 53: public void doFilter(ServletRequest request, ServletResponse
response,
Line 54: FilterChain chain) throws IOException, ServletException {
Line 55: // Cast to HttpServletRequest/Response.
Line 56: final HttpServletRequest httpRequest = (HttpServletRequest)
request;
Line 57: final HttpServletResponse httpResponse = (HttpServletResponse)
response;
The question is, what do I do besides die a spectacular death, which would
happen with the cast as well.
Line 58:
Line 59: if (cacheFilterPatternMathes(httpRequest)) {
Line 60: HttpServletResponseWrapper responseWrapper =
getCacheHeaderResponseWrapper(httpResponse);
Line 61: httpResponse.setHeader(CACHE_CONTROL, CACHE_YEAR);
Line 59: if (cacheFilterPatternMathes(httpRequest)) {
Line 60: HttpServletResponseWrapper responseWrapper =
getCacheHeaderResponseWrapper(httpResponse);
Line 61: httpResponse.setHeader(CACHE_CONTROL, CACHE_YEAR);
Line 62: httpResponse.setHeader(EXPIRES, getNowPlusYearHttpDate());
Line 63: chain.doFilter(request, responseWrapper);
Right for the expires header.
Line 64: } else if (noCacheFilterPatternMatches(httpRequest)) {
Line 65: chain.doFilter(request, response);
Line 66: httpResponse.setHeader(CACHE_CONTROL, NO_CACHE);
Line 67: httpResponse.setHeader(EXPIRES, getYesterdayHttpDate());
Line 65: chain.doFilter(request, response);
Line 66: httpResponse.setHeader(CACHE_CONTROL, NO_CACHE);
Line 67: httpResponse.setHeader(EXPIRES, getYesterdayHttpDate());
Line 68: } else {
Line 69: chain.doFilter(request, response);
Basically the whole point of this patch is so we have the caching disabled for
a couple of pages (defined by the regex). So we really need to use the wrapper
to prevent JBOSS from setting the expires value.
Line 70: }
Line 71: }
Line 72:
Line 73: private String getYesterdayHttpDate() {
Line 104: httpResponse.setHeader(name, value);
Line 105: }
Line 106: }
Line 107: };
Line 108: }
No JBOSS sets the cache, we want it NOT to be cached.
Line 109:
Line 110: private boolean cacheFilterPatternMathes(HttpServletRequest
httpRequest) {
Line 111: boolean result = false;
Line 112: if (null != cachePattern) {
--
To view, visit http://gerrit.ovirt.org/10449
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I5d8e02ae542a4aa37bd421bde5582c0f3e9820ad
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches