Schepp / CSS-Filters-Polyfill

This polyfill takes the official CSS filters syntax and translates it to the different equivalent techniques that the browsers know for those effects
MIT License
762 stars 66 forks source link

Unnecessary stylesheet caching? #2

Closed stucox closed 11 years ago

stucox commented 11 years ago

I like this polyfill, but the caching it applies with localStorage here makes it hard to develop with.

Why does the library cache stylesheets anyway? Shouldn't that be up to the app's wider caching strategy?

Schepp commented 11 years ago

It caches the stylesheet since not everybody has caching active and it would take ages for the plugin to kick in when retrieving the stylesheet. So what I do is to check if I already have a stylesheet in localStorage, if yes take that and afterwards do the costy fetch over HTTP. Which means, you as developer get to see changes if you hit refresh twice. Not all too bad.

What would you suggest? Turning it off when the host is "localhost" or an IP address? I still want to have that caching on for end users/in production, so that needs to stay the default.

Schepp commented 11 years ago

Try the new version please.