The redirectThrough setting tells the CloudFront plugin to redirect any standard URLs back through the CloudFront distribution, automatically rewriting them to the semicolon syntax so everything will work properly. Change to match the distribution name you created in the AWS console.The CloudFront plugin can automatically redirect image requests to use the CloudFront distribution instead of directly serving the request. Automatic redirection of standard ( image.jpg?width=.) URLs back to the CDN. by adding " invalidate=1" to it), or by using Amazon's invalidation request feature. If you need to invalidate a cached file sooner than 24 hours, you must change the url (ex. To set the caching time at the server instead of at CloudFront, set in the section of Web.config. Caching duration notesīy default, CloudFront caches all requests for a minimum of 24 hours (1440 minutes), but you can now configure this limit when you create a new distribution. Unless you set up a CNAME to mask it, your URL will look like this: width=100įeel free to play around with my URLs and experiment. The CDN sends the request on to the origin server, caches the response, and sends it back to the current (and any future) clients. Here's a URL pointing to the CDN (I've set up a CNAME to mask the distribution name). Here's a URL directly to my origin server This allows us to reference a CDN server, but still dynamically process and edge-cache images. To avoid this limitation, we've devised an alternate syntax using semicolons. Many CDNs strip off all querystring data before passing the request on to the origin server (the Image Resizer). InstallationĮither run Install-Package in the NuGet package manager, or: If you can do that, you don't need this plugin. When you create a 'distribution' or 'endpoint', you often have the chance to enable querystring support. Makes the ImageResizer work nicely with CDNs that strip off query strings by default, such as Amazon CloudFront and Azure CDN.
0 Comments
Leave a Reply. |