mod rewrite - Is HTTP 301 the best way to integrate an existing website with AWS CloudFront? -



mod rewrite - Is HTTP 301 the best way to integrate an existing website with AWS CloudFront? -

we have existing web product uses lot of static images, css files, js libs , other static content. whenever page loaded, browser has create dozens of additional http requests retrieve content doubles load time. wanted set content amazon's cloudfront improve load times , trying take between 2 possible ways of implementing this.

1). going through every single reference such content , replacing request cloudfront. e.g. images/image.jpg become qwerty.cloudfront.net/images/image.jpg. result in "true" integration practically impossible me implement this. different js libs come own images take dynamically.

2). leave images/image.jpg , tell server 301 cloudfront such requests. problem implementation requests have routed way server before server can redirect them cloudfront.

so not sure if 301 idea. work if time route request our server negligible compared time takes server send image client. additionally don't know how server handle load spikes - survive if traffic spike happens , have serve lot of 301 redirects (although assume will, since doing should much easier retrieving files file scheme , outputting them). please allow me know if have experience or thoughts on matter (including other potential ways of implementing integration).

mod-rewrite nginx amazon-web-services cdn amazon-cloudfront

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -