The web client uses the standard ETag HTTP header to enable browsers to properly cache the minified version of all the JS, CSS and QWeb files used by the web client. This is handled by the /js
, /css
and /qweb
controllers, which will return an empty 304 Not Modified
response if the cached file is fresh enough, saving the bandwidth. This was introduced in OpenERP 6.1 at this revision.
You can watch this mechanism in action using the Network tab of your browser's debugging tools (For Chrome): when the server returns the minified file it also sends an ETag
header with the checksum of the minified files. Later when your browser tries to reload this file it will send an extra If-None-Match
header when with the ETag
value of the cached file. If the checksum has not changed (no file was modified/added), the response will be an empty 304 Not Modified
, otherwise a normal 200
with the file contents and the new ETag
header.
Note that in debug mode there is no minification of the source files, so you may easily compare both situations.
It is important to force a new download of the minified bundle as soon as any of the underlying files is modified/added, otherwise the web client will not work as expected, obviously.
In terms of bandwidth the minified version should take roughly half the size of the typical plain source, and if you really want to save on bandwidth you should really deploy OpenERP behind an nginx
reverse-proxy with gzip compression enabled. This will make a big difference for slow links.
Thanks Oliver.
As always. Great answer... seeing a way to improve our deployments with this information.
REgards.