Search code examples
javascripthtmlcachinghtml5-appcache

Cache Website after login


Let me explain my situation

I have a website that is connected with mysql to verify login credentials so the user can login to his profile page. I have read about HTML 5 App cache and it suits me,but how can i force App cache to cache files for offline use after the login verification?

I know that i can store (username and password) in javascript but this is wrong because anyone can see the username and password after.

So to summarise, is it possible my Website to be stored offline with app cache but after the login page?


Solution

  • App Cache (or manifest) is a list of files you want to make available for offline. It usually isn't related to being logged in or not.

    I suppose, there's nothing to stop you dynamically generating the file after the user is logged in, with all files related to that user. For example, if you have a website where a user uploads art, you could generate a manifest for their collection.

    However, when you change the manifest file, the browser will try to redownload everything which may not be the desired effect.

    For logins, store a randomly generated cookie.