mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(main) generateHeaders: if no cache: max-age - 0
This commit is contained in:
parent
01fa9b8035
commit
684fa80750
1 changed files with 6 additions and 3 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue