Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8967795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:19:30+00:00 2026-06-15T17:19:30+00:00

I have a web server which provides an ETag for a particular url. When

  • 0

I have a web server which provides an ETag for a particular url. When the browser performs a request for this url, it provides the http-header “If-None-Match” with the ETag-value contained in the previous response from the server for that url. Now, if I programatically add the request-header “If-Modified-Since” and set it to a either a future or past date (doesn’t matter), the browser stops sending the “If-None-Match”-header. I have seen this in both FireFox and Chrome (not tested with any other browser). I can’t conclude from the HTTP/1.1 spec that this should be the case. Why does this happen?

Here is a simple code example that will reproduce the scenario. The code assumes that the server responds with an Etag-header.

var request = new XMLHttpRequest();
request.open("GET", someUrl, true);
request.onreadystatechange = function(){};

// This statement makes the browser stop sending the "If-None-Match" header
request.setRequestHeader("If-Modified-Since", "Sat, 29 Oct 1994 19:43:31 GMT"); 

request.send(null);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:19:31+00:00Added an answer on June 15, 2026 at 5:19 pm

    Now, if I programatically add the request-header “If-Modified-Since” and set it to a either a future or past date (doesn’t matter), the browser stops sending the “If-None-Match”-header.

    They shouldn’t, if the server provides in both an Etag and Last-Modified header for the given resource:

    HTTP/1.1 clients […] if both an entity tag and a Last-Modified value have been
    provided by the origin server, SHOULD use both validators in
    cache-conditional requests. This allows both HTTP/1.0 and
    HTTP/1.1 caches to respond appropriately.

    Edit: when calling XmlHttpRequest.open(), the implementation prepares a request using an nsIHttpChannel, using among others the If-Modified-Since and If-None-Match headers if it can find a local cached item.

    Now when you call SetRequestHeader() with either If-(Un)Modified-Since or If-None-Match, it’ll clear both headers from the request and sets your value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web server which is protected behind http-basic-auth. I've read through the
I have an Apache server running which hosts a php web application. This server
I have one ASP.NET web application running at the web server root which provides
I have a web app which talks to a custom back-end server over HTTP.
I have a web server which I do not know what the time zone
I have written a mini web-server which needs to serve up a few static
I currently have a single web server hosting multiple WordPress sites which use W3TC.
I have a windows 2003 server (WEb edition) which has .net 3.5 sp1 installed
I have a program that downloads PCM data from a Web Server, which it
I have a web application, which is using a SQL Server 2005 database. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.