0

i´m getting some strange behaviour when i deployed my web app on windows server with Microsoft IIS.

creating an image object

 img = new Image() ; 
 img.src = 'someimg.png' ;
 img.addEventListener('load', incrementImageCount ) ;

I´m doing image preloading via javascript and locally it works perfect, but when i deploy on the server the browser request an image every time it´s draw or redraw. So i have some awful looks while it´s loading. So in resources on web inspector i see the same images, multiple times.

Any ideas why this may be happening?

Paranoid42
  • 118
  • 7
  • You should use a tool like "Tamper Data" for Firefox to examine the HTTP headers the server is sending with the image. – Pointy Jul 11 '13 at 04:02
  • Also, it's not the **server** that's requesting the image, it's the **client**. – Pointy Jul 11 '13 at 04:03
  • the server is probably responding with headers preventing the client from cacheing – Orangepill Jul 11 '13 at 04:07
  • this are the response headers Accept-Ranges:bytes Access-control-allow-headers:* Access-control-allow-methods:PUT, GET,POST Access-Control-Allow-Origin:* Content-Length:18266 Content-Type:image/png Date:Thu, 11 Jul 2013 04:08:36 GMT ETag:W/"0f1308507ece1:0" Last-Modified:Thu, 11 Jul 2013 06:33:14 GMT Server:Microsoft-IIS/7.5 X-Powered-By:ASP.NET – Paranoid42 Jul 11 '13 at 04:09
  • yes i forgot a colon when i deploy on the server, the browser(client) request an image – Paranoid42 Jul 11 '13 at 04:10
  • any idea where the problem is on that? – Paranoid42 Jul 11 '13 at 04:10

0 Answers0