pemiluAPI / peta-caleg

design & development of a candidate map for Indonesia's 2014 legislative elections
1 stars 4 forks source link

Having local storage/cache for API Call result #46

Closed ykt closed 10 years ago

ykt commented 10 years ago

Just suggestion to improve after first visit, second visit should be handle by client only (web browser). Perhaps any result, at the first request we cache somewhere, HTML5 storage or others.

shawnbot commented 10 years ago

This makes it a lot harder to know when the authoritative information in the API has been updated, without resorting to some sort of HEAD request to determine if the cached data is out of date. Browsers should do this automatically with the appropriate HTTP cache headers, which would be handled in pemiluAPI/pemiluAPI.