質問

I am using the Application Cache feature and all is working well, however when I cache resources initially, I include a few pages that need to be accessible online. These pages are behind a login screen, and show the login screen instead of the actual page if the user is not logged in. So when they are cached, it's cached with the login screen.

I want to refresh my app cache after logging in / out so that it properly reflect the pages if the user's connection drops out after logging in.

I know that the cache manifest only gets called for update if the file itself actually changes, and this is posing a problem as I can't think of a way to update the file after the login / logout is called.

Unfortunately I can't use a separate cache manifest on different pages as the page is dynamically templated into the one HTML file with Mustache templates.

How can I programatically ask the browser to update my application cache after logging in / out?

役に立ちましたか?

解決

Could you pass along an id with the manifest url?. Since the session id will change after a logout/login the browser will see the manifest as a different file although it actuall did not change.

<html manifest="myManifest.mf?id=<?= session_id() ?>">
  ...
</html>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top