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 158585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:42:27+00:00 2026-05-11T10:42:27+00:00

I have developed a solution that relies on an AJAX call to retrieve information

  • 0

I have developed a solution that relies on an AJAX call to retrieve information and update the client page every 10 seconds. This is working fine, but I am concerned at the scalability of the code, given the number and length of headers being passed from client to server and back again. I have removed a number of redundant headers on the server side, mostly ASP.NET-related, and now I’m attempting to cut down on the headers coming from the client.

The browser used by my company is IE (version 6, to be upgraded to 7 soon). This is an approximation of my current code:

var xmlHTTP = new ActiveXObject('Microsoft.XMLHTTP');  xmlHTTP.onreadystatechange = function() {     if ((xmlHTTP.readyState == 4) && (xmlHTTP.status == 200)) {         myCallbackFunction(xmlHTTP);     } };  xmlHTTP.open('GET', 'myUrl.aspx');  try {     xmlHTTP.setRequestHeader('User-Agent', '.');     xmlHTTP.setRequestHeader('Accept', '.');     xmlHTTP.setRequestHeader('Accept-Language', '.');     xmlHTTP.setRequestHeader('Content-Type', '.'); } catch(e) {}  xmlHTTP.send(); 

Although I’ve read that it’s possible to clear some of these headers, I haven’t found a way of doing it that works in IE6. Setting them to null results in a Type Mismatch exception, so I’ve ended up just replacing them with ‘.’ for the time being. Is there another way of clearing them or an alternative method of reducing the submitted HTTP headers?

Also, there seems to be no way of replacing or shortening the ‘Referrer’ header at all.

  • 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. 2026-05-11T10:42:28+00:00Added an answer on May 11, 2026 at 10:42 am

    According to the WD spec

    The setRequestHeader() method appends a value if the HTTP header given as argument is already part of the list of request headers.

    That is, you could only add headers, not replace them.

    This doesn’t completely match current browser behaviour, but it may be where browsers will be headed, in which case any efforts on this front are a waste of time in the long term. In any case current browser behaviour with setting headers is very varied and generally can’t be relied upon.

    There seems to be no way of replacing or shortening the ‘Referrer’ header at all.

    That wouldn’t surprise me, given that some people misguidedly use ‘Referer’ [sic] as an access-control mechanism.

    You could try to make sure that the current page URL wasn’t excessively long, but to be honest all this smells of premature optimisation to me. Whatever you do your request is going to fit within one IP packet, so there’s not gonig to be a big visible performance difference.

    It may be worthwhile for Mibbit (as mentioned on the blog you linked) to try this stuff, because Mibbit draws a quite staggering amount of traffic, but for a simple company-wide application I don’t think the cross-browser-and-proxy-testing-burden:end-user-benefit ratio of messing with the headers is worth it.

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

Sidebar

Related Questions

I have developed a .NET solution that consists of several assemblies, most of which
I currently have a single solution that contains both the one application developed so
I have a webapp development problem that I've developed one solution for, but am
I'm very newbie to Ubuntu OS and I have my solution developed in visual
We have an ASP.Net MVC 1.0 solution developed using Visual Studio 2008 and .net
I have developed a simple library in Ruby and need to use this in
I have developed code on a m-file script in Matlab that communicates with a
I have developed a small application that I would like to try and sell
I have developed a Wordpress site that loads pages dynamically using the .load function.
I have developed some reusable android component which is basically a class . This

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.