Questions tagged [http-headers]

In the Hypertext Transfer Protocol (HTTP), HTTP header fields contain the operating parameters of an HTTP request or response. With the request or response line (first line of message), they form the message header.

174 questions
143
votes
5 answers

Difference between the Accept and Content-Type HTTP headers

So the Accept header tells the server the MIME-type of the resource the browser is looking for. For example, the server can send plain text, HTML, JSON, etc. OK, that makes sense, but when I look at the Content-Type header and it seems to be doing…
JohnMerlino
  • 1,573
  • 2
  • 11
  • 6
49
votes
2 answers

What is recommended minimum object size for gzip performance benefits?

I'm working on improving page speed display times, and one of the methods is to gzip content from the webserver. Google recommends: Note that gzipping is only beneficial for larger resources. Due to the overhead and latency of compression and…
utt73
  • 654
  • 1
  • 6
  • 11
33
votes
6 answers

Headers to prevent 304/If-modified-since/HEAD requests

What headers should I be sending to outright stop all requests to the server after the content has been cached? We have a very high latency server (Sigh, VMWare) so even sending a HEAD request to the server takes +40ms. Currently these are the…
Blank
  • 660
  • 1
  • 6
  • 10
22
votes
2 answers

What are the Consequences for using Relative Location Headers?

According to the spec, Location headers used in a redirect require a server name HTTP/1.1 301 Moved Permanently ... Location: http://example.com/foo/baz/bar However, in 2012, most web browsers will recognize a relative path and redirect you to the…
Alana Storm
  • 620
  • 1
  • 5
  • 9
19
votes
2 answers

Setting X-Forwarded-Proto under Apache 2.4

Ive been advised that I need to set the RequestHeader X-Forwarded-Proto for a node.js application (NodeBB) to resolve an issue with sessions / csrf tokens. Here's the relevant excerpt from my apache2 config: ProxyRequests off Order…
codecowboy
  • 323
  • 1
  • 3
  • 9
18
votes
2 answers

Font blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin'

we are experiencing this error in Google Chrome. We thought everything was set-up correct. But maybe not? Font from origin http://skin.cdn.com has been blocked from loading by Cross-Origin Resource Sharing policy: No …
snh_nl
  • 653
  • 2
  • 6
  • 17
18
votes
1 answer

Character set not specified in HTTP headers error

When testing this page with Page Speed, I get the a Specify a character set error: The following resources have no character set specified in their HTTP headers. Specifying a character set in HTTP headers can speed up browser rendering. The…
Alex
  • 1,023
  • 1
  • 11
  • 21
14
votes
1 answer

What's the best way to end a Web site?

I have a Web site, built on ASP.NET MVC 3, that will be closing down completely. The domain will still be required for a few months, so during that time I'd like to display a single message on at least the main page. I'm thinking that standards…
James Skemp
  • 307
  • 6
  • 15
13
votes
2 answers

Does the 'Server' header serve any purpose?

For example, when I dump the response header for my server I get: Server: Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.5 with Suhosin-Patch mod_ssl/2.2.11 OpenSSL/0.9.8g Is this used for anything? Is it a security risk (albeit small) broadcasting the…
DisgruntledGoat
  • 21,658
  • 5
  • 56
  • 101
12
votes
1 answer

If I only serve gzipped version of my content, should I add the vary accept encoding header?

I just moved a static site from a VPS to Amazon S3. I have decided to serve only gzipped version of my pages, since S3 is not a webserver I can't have logic based on headers. I also use Cloudfront as CDN. I was testing my page with…
Kev
  • 335
  • 1
  • 2
  • 9
12
votes
2 answers

Considerations of the HTTP Content-MD5 Header

We are debating whether to use the Content-MD5 header. Pros: The CMS allows us to easily include it with minimal overhead (cached responses in 80%+ of the cases). It would add another layer of protection against problems. Cons: The Content-Length…
Metalshark
  • 3,683
  • 2
  • 21
  • 39
11
votes
2 answers

How to get keywords from Google HTTP referrer?

Can the http referrer URL from Google be decoded so that I can see the specific…
Marek Andreansky
  • 912
  • 2
  • 9
  • 20
11
votes
1 answer

IP Address headers (Remote_Addr) - When is this header sent by the browser?

I want to know when a browser includes the header - Remote_Addr in the HTTP request. I observed the request sent by the browser on loading stackoverflow.com, in the web console window of Firefox. There were no headers pertaining to IP address sent.…
Ashwin
  • 249
  • 1
  • 2
  • 9
10
votes
2 answers

Why is "29030400" seconds used as a common value for cache expiration?

I noticed that 29030400 is used very often in the Expires directives for static files. Google recommends to cache this kind of files up to 1 year (1 month at least). I did the math: 29030400 seconds = 336 days That is about 1 year minus 1 month, so…
heytools
  • 386
  • 1
  • 11
9
votes
3 answers

How should an expired content be handled?

Let's imagine this simplified case: An auction website has "auction detail" pages. A few weeks after the auction is over, the "auction detail" page is no more available. We are simply serving a HTTP/1.1 410 Gone with the page providing the…
Toto
  • 345
  • 2
  • 13
1
2 3
11 12