Removing HTML5 Appcache Manifest, Permanently

后端 未结 4 1539
予麋鹿
予麋鹿 2020-12-11 02:04

I setup an Application Cache on a site and shortly thereafter realized its way more aggressive that I realized. I want to remove it. Permanently.

I\'ve read that pas

4条回答
  •  没有蜡笔的小新
    2020-12-11 02:31

    I've been having a similar issue where I needed to reset the appcache after a failed update (i.e. force a complete removal of the appcache so that it can be re-built from scratch).

    Building on Maurice's answer I present the user with a normally hidden link that opens a non-cached page, which just writes a cookie and returns the user to the previous view. This cookie tells the server to return a 404 the next time the appcache is requested, and the user is then taken through the normal login process. When the application next successfully runs it clears the cookie and caching resumes as normal.

    Using a cookie in this way gets around issues where the master version of the view is stuck in the appcache, making it difficult to inject a breaking url into manifest="" i.e. the manifest url stays the same, but the server responds with a 404 until told otherwise.

提交回复
热议问题