使用301/303/307重定向进行动态短网址 [英] Using 301/303/307 redirects for dynamic short urls

查看:387
本文介绍了使用301/303/307重定向进行动态短网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在实施一个短网址服务,其中重定向目标将每天更改。网址将由移动设备访问,并始终是GET请求。我试图了解哪个是最适合这项工作的300型重定向。

We're implementing a short url service where the redirection target will be changing daily. The urls will be accessed by mobile devices and will always be GET requests. I'm trying to understand which is the best 300-type redirect for the job.

AFAIK大多数网址缩短服务使用301重定向(永久移动)。但是,根据规格,303(见其他)和307(暂时移动)重定向似乎是为我们的案例设计的......

AFAIK most url shortening services use 301 redirects (Moved permanently). However, according to the specs, the 303 (See other) and 307 (Moved temporarily) redirects seems like they were designed for our case...


  • 303/307是否支持301?规格说它们只在HTTP 1.1中实现 - 这个拼写有什么限制?

  • 选择301 vs 303/307是否有任何实际的缓存或性能影响。

  • 对于GET请求,有没有理由选择303 vs 307?

  • 有没有理由使用302重定向?

  • 还有其他需要考虑的事项吗?

  • Are 303/307 as well supported as 301? The specs say they were only implemented in HTTP 1.1- what limitations does that spell?
  • Are there any actual caching or performance implications of choosing 301 vs 303/307.
  • For GET requests, is there any reason to pick 303 vs 307?
  • Is there any reason to use 302 redirects?
  • Any other things to consider?

推荐答案


是303/307和301支持?规范说它们只在HTTP 1.1中实现 - 这个拼写有什么限制?

Are 303/307 as well supported as 301? The specs say they were only implemented in HTTP 1.1- what limitations does that spell?

是/否。


选择301 vs 303/307是否有任何实际的缓存或性能影响。

Are there any actual caching or performance implications of choosing 301 vs 303/307.

我不这么认为。


对于GET请求,有没有理由选择303 vs 307?

For GET requests, is there any reason to pick 303 vs 307?

303的语义与307不同。如果请求的资源是其他地方,则303不是正确的答案。

303 has semantics different than 307. If the requested resource is "somewhere else", 303 is not the right answer.


有没有理由使用302重定向?

Is there any reason to use 302 redirects?

不真的,据我所知。它具有与307相同的语义,但是UA可能会重写对GET的POST请求。

Not really, as far as I can tell. It has the same semantics as 307, but the UA might rewrite a POST request to GET.


还有其他需要考虑的事项吗?

Any other things to consider?

参见 http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p2-semantics-18.html#status.3xx

这篇关于使用301/303/307重定向进行动态短网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆