• Post Reply Bookmark Topic Watch Topic
  • New Topic

multiple declaration of the same header.

 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are multiple declaration of the same header required in the same document?

Eg:
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
response.setHeader("Expires", "Sat, 12 August 1990 12:00:00 GMT");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Who says they're required?

A "META HTTP-EQUIV="PRAGMA" is the equivalent of the HTTP header "PRAGMA" - hence "HTTP-EQUIV". Two identical headers serve no reasonable purpose.
 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since i came across a code wherein the declaration mentioned exists.
Also would like t know what does the below mean?

response.setDateHeader("Expires", 0);
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you can safely remove the META tag.

"Expires" sets a date and time after which a browser should no longer use the cached copy, but instead fetch a fresh copy. See also http://faq.javaranch.com/java/NoCacheHeaders
 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What below instruction execution does?

response.setDateHeader("Expires", -1); //......?what it does
response.setDateHeader("Expires", 1);//........?what it does
response.setDateHeader("Expires", 0); //........as i understood this instruction mean to load a fresh copy of the document/hit.

please correct if i'm wrong
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!