• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multiple declaration of the same header.

 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic