【发布时间】:2019-09-13 14:19:27
【问题描述】:
我遇到了这个问题,并试图解决缓存和重定向问题。根据我阅读的 301 和 302 http protocol,这就是我的看法,a request sends to server (in this case cloudfront) and triggers a direction(基于配置,但我们假设这是默认设置)。在response 中,客户端会看到一个301 或302,即indicates the resources they get back。如果状态为301,则表示将link has permanently moved、therefore new resources will return返回给客户端。而 302 告诉客户端 resource is found and here it is, without doing any further action.
从上面的引用中,这是否意味着 301/307 将从后端返回缓存的资源? Cloudfront 是否使用不同的重定向状态码?
我知道我在一篇文章中有太多问题,但我主要关心的是缓存和重定向。有人可以用外行术语解释这种关系吗?提前谢谢你
顺便说一句,这就是我触发重定向的方式:
导航到https://example.com/index.html
<!DOCTYPE html>
<head>
<meta http-equiv="refresh" content="0; url=https://example.com/copy/index.html">
<link rel="canonical" href="https://example.com/copy/index.html">
</head>
补充说明:
解释我们应该如何管理 Cloudfront 上的缓存
【问题讨论】:
标签: redirect caching amazon-cloudfront browser-cache