What is the HTTP 305 status code? How to use it?

All I found: β€œThe requested resource MUST be accessible through the proxy server specified by the Location field. The Location field specifies the URI of the proxy server. It is expected that the recipient will repeat this single request through the proxy server. Be generated by origin servers . "

How to use it? What if there is no proxy at the specified URL?

+3
source share
2 answers

Its redirection, you use it when you want to inform the client that he is receiving content from another place. The given URI does not have to be a β€œproxy” in conversation. This is just another place where the originally requested content exists.

People use it to balance the load. I'm not sure if clients are implementing it correctly, so if you just want to redirect, you will be safer with 302.

Edit

The intended use case is as described in the HTTP RFC: let's say you have a caching proxy, and the content on it comes from a real server (source server). You would send 305 if someone directly accessed the real server, and you wanted them to get it from the proxy.

+6
source

, , - ? , , - . , 305 HTTP?

" ", , , ? - .

, 305 ? , 305.

HTTP, , 302, , - ( ).

+3

Source: https://habr.com/ru/post/1785298/


All Articles