When CloudFront requests an object from your Amazon S3 bucket or custom origin server, your origin sometimes returns an HTTP 3xx status code, which typically indicates either that the URL has changed (301, Moved Permanently, or 307, Temporary Redirect) or that the object hasn't changed since the last time CloudFront requested it (304, Not Modified). CloudFront caches 3xx responses for the duration specified by the settings in your CloudFront distribution and by the header fields that your origin returns along with an object. For more information, see Specifying How Long Objects Stay in a CloudFront Edge Cache (Expiration).
If your origin returns a 301 or 307 status code, CloudFront doesn't follow the redirect to the new location.