Amazon S3: Cache-Control and Expiry Date difference and setting trough REST API

后端 未结 3 739
Happy的楠姐
Happy的楠姐 2020-12-31 20:45

I want to enhance my sites loading speed, so I use http://gtmetrix.com/, to check what I could improve. One of the lowest rating I get for \"Leverage browser caching\". I fo

3条回答
  •  借酒劲吻你
    2020-12-31 21:27

    Your files won't be deleted, just not cached after the expiration date.

    The Amazon docs say:

    After the expiration date and time in the Expires header passes, CloudFront gets the object again from the origin server every time an edge location receives a request for the object.

    We recommend that you use the Cache-Control max-age directive instead of the Expires header field to control object caching. If you specify values both for Cache-Control max-age and for Expires, CloudFront uses only the value of max-age.

提交回复
热议问题