Why does browser caching not work correctly with Cloudfront/S3/CORS? -
i have correctly enabled cors back upwards on amazon cloudfront static images can used webgl textures.
i request images via javascript:
var image = new image(); image.crossorigin = 'anonymous'; image.onload = function(){ //do stuff here }; image.src = url;
however, when requesting images via cors, browser caching doesn't appear work correctly, @ to the lowest degree not in same manner when disabled.
my app extremely image heavy single page app, requests/page changes beingness driven ajax principles. cors disabled, navigating through site extremely fast when images cached browser. pressing forward/back browser buttons results in near instantaneous response.
however, cors enabled, browser seems contact server each , every image. if in browsers cache. requests don't re-download assets, waiting
time (as shown in firebug's network profiler) each request noticeable, indicating cloudfront beingness nail , checked every request, if in browsers cache.
is there anyway modify can have same browser caching behaviour when images requested without cors?
cors amazon-cloudfront
No comments:
Post a Comment