BrowserStorageAbuser icon indicating copy to clipboard operation
BrowserStorageAbuser copied to clipboard

Add Cache API

Open mattijsbliek opened this issue 9 years ago • 11 comments

Firefox, Chrome, and Opera now offer basic support, so would be great to add this.

My first guess would be that storage for the Cache API is the same as that for IndexedDB, but I might be wrong.

mattijsbliek avatar Oct 12 '15 13:10 mattijsbliek

Great suggestion! Will try to find time to work on it but PRs are always welcomed :)

agektmr avatar Oct 12 '15 22:10 agektmr

Great, I'll try to work on something tomorrow :)

mattijsbliek avatar Oct 13 '15 07:10 mattijsbliek

I'm a bit out of my depth here. Will continue to work on something, but it will take longer than I anticipated.

mattijsbliek avatar Oct 14 '15 13:10 mattijsbliek

No worries. Will have a look myself when I have time.

agektmr avatar Oct 14 '15 20:10 agektmr

Anything happen with this? Would love to do some testing around this API :)

pieterv avatar Jun 21 '16 10:06 pieterv

Unfortunately I'm too busy to work on this soon. Pull Requests are super appreciated.

agektmr avatar Jun 23 '16 09:06 agektmr

I took another look at implementing this and it might be tricky to implement fully. Firefox uses the same quota as for IndexedDB. But since this quota is per origin, it can vary according to how many domains your caching files from. Ideally you would be able to select the number of origins (say 1 through 5) you will be caching from. As a first version however, you could of course just use the root origin only.

More importantly, you can only add things to the Cache API that are served from a secure origin. So the BrowserStorageAbuser demo would need to run on https before the Cache API can be implemented.

I can't take care of the https part for the demo, but I can try giving this another go somewhere in the next week or so.

mattijsbliek avatar Jun 23 '16 09:06 mattijsbliek

Making the site working on HTTPS shouldn't take that much time. I'll work on it.

agektmr avatar Jun 23 '16 09:06 agektmr

Tried giving this another go but I'm having a hard time seeing what's going on in the code, and not being very familiar with Angular doesn't help. I don't think I'll be able to add the Cache API myself, sorry!

mattijsbliek avatar Jun 27 '16 19:06 mattijsbliek

@mattijsbliek thanks for your challenge. I know it's a messy code but can be much simpler with ES6. I'll give it a try when I find some time.

agektmr avatar Jun 28 '16 00:06 agektmr

No worries, thanks for looking into it @mattijsbliek.

pieterv avatar Jun 28 '16 01:06 pieterv