Tag Info

New answers tagged

4

Because, in your example, web server would always send CSS and images regardless if the client already has them, thus greatly wasting bandwidth (and thus making the connection slower, instead of faster by reducing latency, which was presumably your intention). Note that CSS, javascript and image files are usually sent with very long expire times for exactly ...


1

Redirects are great for resources that have moved. Instead of a 301 permanent redirect (which would indicate a rename without API changes), I would use a 303 "See Other" redirect.


6

There doesn't seem to be a standard. The StackOverflow answer leans towards 410 GONE, but I think 301 MOVED PERMANENTLY is more appropriate. To make the correct choice, we have to look at your specific case. If your goal is to have all calls being made to API v1 fail without taking any further action, 410 GONE works for that. If you want some continuity, ...


3

Interesting - I never knew that! Just tested from my custom web server (Rapid Server) and got the same results (3 GET requests after clicking on a hyperlink), so we know it's not the web server: 127.0.0.1:1062 - - [17/Oct/2014:03:57:45 -0700] "GET / HTTP/1.1" 0 127.0.0.1:1063 - - [17/Oct/2014:03:57:47 -0700] "GET / HTTP/1.1" 0 127.0.0.1:1064 - - ...


9

Your web browser doesn't know about the additional resources until it downloads the web page (HTML) from the server, which contains the links to those resources. You might be wondering, why doesn't the server just parse its own HTML and send all the additional resources to the web browser during the initial request for the web page? It's because the ...


3

Because it doesn't assume that these things are actually required. The protocol doesn't define any special handling for any particular type of file or user-agent. It does not know the difference between, say, an HTML file and a PNG image. In order to do what you're asking, the Web server would have to identify the file type, parse it out to figure out what ...


6

HTTP2 is based on SPDY and does exactly what you suggest: At a high level, HTTP/2: is binary, instead of textual is fully multiplexed, instead of ordered and blocking can therefore use one connection for parallelism uses header compression to reduce overhead allows servers to “push” responses proactively into client caches More is ...


50

The short answer is "Because HTTP wasn't designed for it". Tim Berners-Lee did not design an efficient and extensible network protocol. His one design goal was simplicity. (The professor of my networking class in college said that he should have left the job to the professionals.) The problem that you outline is just one of the many problems with the ...


10

Because they do not know what those resources are. The assets a web page requires are coded into the HTML. Only after a parser determines what those assets are can the y be requested by the user-agent. Additionally, once those assets are known, they need to be served individually so the proper headers (i.e. content-type) can be served so the user-agent ...



Top 50 recent answers are included