HTML - How can I check if a file (.js or .css) was loaded or picked up from the cache?

前端 未结 2 511
情歌与酒
情歌与酒 2021-01-18 11:46

First, I needed a way to force browser always load .css and .js files. I solved it by putting a sufix in the files:

Before:



        
2条回答
  •  抹茶落季
    2021-01-18 12:09

    It is browser responsibility area to load resources from server or take it from cache. From client code you cannot determine the source that was actually used (if you don't load resources dynamically using ajax). Only you can is look at the Network tab in Developer Tools (or Firebug).

提交回复
热议问题