Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing waterpoints should invalidate cache #188

Open
kynan opened this issue Oct 16, 2015 · 3 comments
Open

Editing waterpoints should invalidate cache #188

kynan opened this issue Oct 16, 2015 · 3 comments
Assignees
Labels

Comments

@kynan
Copy link
Member

kynan commented Oct 16, 2015

We're caching API requests client side (in particular waterpoints). However editing a Waterpoint does not invalidate this cache.

@kynan kynan added the bug label Oct 16, 2015
@kynan kynan self-assigned this Oct 16, 2015
@kynan
Copy link
Member Author

kynan commented Oct 16, 2015

That's a tricky one, I'm out of ideas: the request for waterpoints is always served from browser cache, no matter what I try. For reasons I can't understand this is not the case for region_name and district_name.

@kynan
Copy link
Member Author

kynan commented Oct 16, 2015

An option might be to explicitly bust the cache using an additional bogus query parameter. This could be an int which is incremented whenever a waterpoint is updated client side. This would of course still not work if waterpoints change server side through another client.

Maybe we can cover both cases by sending a If-Modified-Since header. The question is which value to use (ideal would be the Last-Modified of whichever response is in cache) and how to achieve this using $resource.

@kynan
Copy link
Member Author

kynan commented Oct 16, 2015

Turns out $resource does send an If-Modified-Since header, however I can't figure out which timestamp it picks and can't find that documented anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant