简体   繁体   English

如何为所有js文件设置请求标头以在extjs中进行缓存?

[英]How to set request headers for all js-files for caching in extjs?

.js-files are downloading from server side but not from browser cache every time I reload a page with the following headers: 每次重新加载具有以下标头的页面时,.js文件都是从服务器端下载的,而不是从浏览器缓存中下载的:

Response headers: Cache-Control:max-age=31556926
Request headers: Cache-Control:max-age=0

If I click somewhere to load a new panel which was already loaded before page reload, this panel (its .js-file) will be received from the cache. 如果我单击某处以加载新的面板,而该面板在页面重新加载之前已加载,则将从缓存中接收到该面板(其.js文件)。

If to reload this page which already contains that cached panel, all the .js-files including that panel will be once again downloaded from the server. 如果要重新加载已经包含该缓存面板的页面,则包括该面板在内的所有.js文件都将再次从服务器下载。

I'm using Chrome for debugging, "Disable cache" checkbox is not checked. 我正在使用Chrome进行调试,未选中“禁用缓存”复选框。

The question is how to force all .js-files including ext-all.js be cached after the page reload? 问题是如何在页面重新加载后强制所有包括ext-all.js的.js文件进行缓存?

Could the server side be a cause? 服务器端可能是原因吗?

AFAIK,当按下(或调用)浏览器重新加载时,页面的所有组件始终从服务器(而不是从缓存)加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 WebStorm 中调试 .NET 嵌入式 js 文件? - How to debug .NET embedded js-files in WebStorm? 将小型js文件合并为一个较大的文件 - Merge small js-files into one bigger ES6中的Javascript类,如何将其导入其他js文件和html文件中? - Javascript classes in ES6, how to import them within other js-files and in html files? 如何使用 Angular 8 在 TypeScript 中访问 JavaScript 内容(或扩展其他 JS 文件的 JavaScript 文件) - How to access JavaScript content (or JavaScript files extending other JS-Files) in TypeScript by using Angular 8 如何在不破坏任何功能的情况下使用 barba.js 运行其他 JS 文件 - How to run other JS-files with barba.js with out breaking any functions Ember.js-在某些模板中加载其他.js文件 - Ember.js - Loading additional .js-Files in some templates Express,如何在所有请求的所有路由上设置自定义请求标头? - Express, how to set custom request headers on all routes for all requests? 外部js文件彼此不认识 - external js-files don't know each other NSIS-js文件解压缩需要很长时间 - NSIS - js-files decompression takes very long UserControl调用JS文件,但似乎没有被调用 - UserControl calling JS-files but they don't seem to get called
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM