louisremi / background-size-polyfill

Adds support for background-size "cover" and "contain" to IE8
http://louisremi.github.com/background-size-polyfill/
MIT License
1.26k stars 359 forks source link

CDN/Amazon S3 - any special considerations? #29

Open fredboyle opened 10 years ago

fredboyle commented 10 years ago

Trying to use this polyfill but our app stores all static files and assets in an S3 bucket. This doesn't seem to play nice with the polyfill.

Are there any tips or tricks to make sure that this polyfill plays nice with CDNs?

louisremi commented 10 years ago

This is a problem with IE behaviors (like the .htc used in this polyfill): you _can't_ host it on a different domain, so CDNs aren't an option. I was going to suggest trying to turn in into a data-uri but it seems that it is impossible: http://stackoverflow.com/questions/1145861/has-anyone-gotten-ie8-to-read-dhtml-behaviors-encoded-as-base64d-data-uris

Ultimately, you could work around the "all static files on a CDN" rule by making the behavior a dynamic page, just add the correct mime-type before sending it.