Vojtech Szocs has posted comments on this change.

Change subject: userportal, webadmin: Added caching
......................................................................


Patch Set 10: Verified

Rebased, improved and verified. Added Allon and Yair as reviewers. Please 
review carefully, this is an important change that goes across different 
components.

Besides addressing BZ mentioned in the commit message, this patch introduces 
new concepts into frontend components (credits to Alex):
* 'frontend' module broken down into two separate modules: 'frontend' (jar) 
containing shared code, 'frontend-overlay' (war) containing web application 
overlay (filters and servlets)
* Note: 'frontend' module currently contains GenericApiGWTServiceImpl (Generic 
API servlet), we should consider moving it to 'frontend-overlay' just like 
other servlets (could be done in a separate patch)
* using servlet 3.0 annotations in filters and servlets within 
'frontend-overlay' module, these annotations are picked up by JBoss during 
deployment (no need to duplicate UserPortal/WebAdmin web.xml fragments for such 
filters and servlets)
* Note: it seems that root pom.xml brings in servlet API dependency 
transitively via commons-logging! I've added a 'TODO' comment in root pom.xml - 
in order to safely use servlet 3.0 API in frontend code (e.g. 
'frontend-overlay' module), both UserPortal/WebAdmin pom.xml have to exclude 
servlet-api from commons-logging
* GWT application host page (e.g. {UserPortal|WebAdmin}.html) is now rendered 
via JSP page instead of hard-coded HTML in servlet
* Proper unit tests for filters and servlets within 'frontend-overlay' module

With regard to BZ mentioned in the commit message, CachingFilter implementation 
was improved to address all types of GWT application resources:

(a) Resources intended to be cached forever on the client [module permutations, 
ClientBundle composite images, split points]
* Expires: <nowPlusOneYear>
* Cache-Control: max-age=<oneYear>, public // Note: we use 'public' for caching 
to work with SSL
* Pragma: <emptyString> // Note: set to empty string because JBoss sets 
'Pragma: no-cache' before invoking the filter
* allow setting conditional download headers: Etag, Last-Modified

(b) Resources which always need to be checked for changes [application host 
page, permutation selector script]
* Expires: <nowMinusOneDay>
* Cache-Control: no-cache
* Pragma: no-cache // Note: this is to support older browsers
* allow setting conditional download headers: Etag, Last-Modified

(c) Resources not intended to be cached on the client at all [RPC calls to 
Generic API]
* Expires: <nowMinusOneDay>
* Cache-Control: no-cache, no-store, must-revalidate // Note: we use 'no-cache' 
because of IE
* Pragma: no-cache // Note: this is to support older browsers
* prevent setting conditional download headers: Etag, Last-Modified

Here are some additional changes I made, Alex - let me know what you think:
* frontend-overlay's parent version bumped to 3.3.0-SNAPSHOT
* minor pom.xml improvements
* detailed Javadoc in CachingFilter (maybe an overkill, but still useful in my 
opinion)
* revamped CachingFilter implementation, getCacheHeaderResponseWrapper() is now 
called when any caching policy is matched, preventing JBoss from modifying 
certain headers (Expires, Cache-Control, Pragma, etc.)
* GwtDynamicHostPageServlet now passes JSON objects as request attributes to 
JSP, instead of JSP constructing JSON representation (string) on its own
* GwtDynamicHostPageServlet now uses toString() of JSON objects within 
getMd5Digest() for simplicity
* revamped unit tests, now testing smaller methods as well (besides 
doFilter/doGet)

--
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: 10
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[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]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to