@yumerijs/core 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/session.js +4 -6
- package/package.json +1 -1
package/dist/session.js
CHANGED
|
@@ -292,16 +292,14 @@ class Session {
|
|
|
292
292
|
* @param option 选项
|
|
293
293
|
*/
|
|
294
294
|
setCache(option) {
|
|
295
|
-
const headers = [];
|
|
296
295
|
if (option.etag)
|
|
297
|
-
|
|
296
|
+
this.head['ETag'] = `"${option.etag}"`;
|
|
298
297
|
if (option.modified)
|
|
299
|
-
|
|
298
|
+
this.head['Last-Modified'] = option.modified.toUTCString();
|
|
300
299
|
if (option.maxAge !== undefined)
|
|
301
|
-
|
|
300
|
+
this.head['Cache-Control'] = `max-age=${option.maxAge}`;
|
|
302
301
|
if (option.expires)
|
|
303
|
-
|
|
304
|
-
this.head['Cache-Control'] = headers.join('\n');
|
|
302
|
+
this.head['Expires'] = option.expires.toUTCString();
|
|
305
303
|
}
|
|
306
304
|
static(path, option) {
|
|
307
305
|
// 先查看用户是否在询问文件修改情况
|