Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
793 views
in Technique[技术] by (71.8m points)

javascript - Disable caching for ExtJs app

We have a ExtJS 5.01 app built with Sencha cmd 5.0.1.231.

The issue we are facing is that browsers seem to cache the old version of our application. On looking at the network traffic on chrome when our application is served, i can see that app.js, app.css files all have ?_dc={timestamp} appended to them. Now, that tells me that every time a new version of my app is released (which updates this timestamp), the browsers should get a new version. But it seems like sometimes still the old version get served.

Is there anything else i need to do bust cache?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I don't get it why "sometimes" the browser is caching your files, even when caching is disabled by default. I even force the framework to use cache whenever possible, by putting this peace of code in my app.js:

Ext.Loader.setConfig({
    enabled: true,
    disableCaching: false
});

While developing I open up my DevTools and set Disable cache (while DevTools is open). This will not allow Chrome to cache files.

But it could be that in your app.json you are forcing "caching" into your local storage by setting "update" or "appcache". Check your localstorage and your app.json to verify.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...