fix(main) generateHeaders: if no cache: max-age - 0

This commit is contained in:
coderaiser 2014-06-09 09:14:25 -04:00
parent 01fa9b8035
commit 684fa80750

View file

@ -200,7 +200,8 @@
* https://developers.google.com/speed/docs/best-practices/caching?hl=ru#LeverageProxyCaching
*/
function generateHeaders(params) {
var header, p, extension, type, encoding, isContain, cmp;
var header, p, extension, type, encoding, isContain, cmp,
maxAge = 31337 * 21;
if (params.name) {
p = params,
@ -239,8 +240,10 @@
});
cmp = Util.strCmp(ext, '.appcache');
if (!cmp && p.cache)
header['Cache-Control'] = 'max-age=' + 31337 * 21;
if (!p.cache || cmp)
maxAge = 0;
header['Cache-Control'] = 'max-age=' + maxAge;
if (p.gzip)
header['Content-Encoding'] = 'gzip';