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

Already on GitHub? Sign in to your account

Clear basket.js cache #34

thewillk opened this Issue Jun 17, 2012 · 2 comments


None yet
2 participants

There should be a mechanism through which basket.js will remove all items under its control from local storage (i.e. all items starting with "basket-"). Otherwise, as assets change their cachebuster, basket.js will be leaky. It should do so in a way that doesn't invalidate other parts of the local storage.

The idea is that elsewhere in the application, there's a "app version" check, and if it's incremented, then they clear basket.js.

Ideally, we'd watch for changes in the cachebuster on a per file basis, but since cachebusting is handled differently per app, this would be difficult. On solution is that there's a mechanism to set a regex to identify where assets are the same, but just a different version. This seems like a pita to implement and potentially buggy. Also, it's not mutually exclusive to the "clear everything" approach.


sindresorhus commented Jun 17, 2012

Clear all method is already implemented in the api-rewrite branch: 4c24808

Would that be enough?

Certainly is. My bad.

Note to self, stay off GitHub when you first wake up, or you'll end up missing something obvious. :)

@thewillk thewillk closed this Jun 17, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment