2

We're currently designing a site that has some tracking pixels hard coded into the DOM. One of the pixels returns with a 204 response code(as it should), but Chrome and Firefox make the request twice.

If the request is made asynchronously, there is only one request.

Is there are a reason why a browser would retry a request with a 204 no content response, is this a valid behavior?

to repro:

<html>
   <body>
     <img src="some/source/url.gif" />
    </body>
</html>

and then have your webserver respond to the src url with a 204 response code.

AgentRegEdit
  • 1,089
  • 2
  • 16
  • 32
  • no this is not normal , would you show your code please ? – ProllyGeek Nov 04 '14 at 01:23
  • As a note: [`MDN: [...]The HTML element was an experimental element designed to display pictures. It never was implemented and the standard element must be used. [...]`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/image) – t.niese Nov 05 '14 at 20:58
  • Perhaps a dupe of: http://stackoverflow.com/questions/25819736/why-do-browsers-inefficiently-make-2-requests-here/25871528 – BReal14 Nov 05 '14 at 20:59
  • sorry updated the code, not actually using the image tag, using standard img – AgentRegEdit Dec 06 '14 at 02:38

0 Answers0