OpenLayers OpenLayers

Ticket #1049 (new bug)

Opened 10 months ago

Last modified 8 months ago

Very long URL in imgDiv causes multiple requests for same URL

Reported by: openlayers Assigned to: euzuro
Priority: major Milestone: Future
Component: Tile.Image Version: 2.5 RC1
Keywords: URL, Image, imgDiv Cc:
State:

Description (Last modified by crschmidt)

If an URL is very long for the src image (I am using an URL which is 4407) it's possibile that you will get 2-3 requests for the same image. This is a timing issue. I am running with a single tiled WMS layer. I've verified the problem with firefox 2.0.0.7.

In 2.5 RC1 lines 122-124, the image div is updated.

122 this.imgDiv.src = this.url; 123 OpenLayers.Util.modifyDOMElement(this.imgDiv, 124 null, null, imageSize) ;

in line 122 the first call to the web server to get the image is sent out from the browser.

The in utils.js, lines 154-146 of modifyDOMElement, it looks as if the first request for the image src hasn't been acknowledged? line 155 will cause an identical request from the browser, and line 156 another.

154 if (sz) { 155 element.style.width = sz.w + "px"; 156 element.style.height = sz.h + "px"; 157

It's easy to see it's a timing problem when debugging with Firebug. Putting a breakpoint before setting the src and on the return from the modifyDOMElement, three requests go out. Instead if I step into modifyDOMElement, i.e. giving the "this.imgDiv.src = this.url;" the extra second or two to get going, lines 155-156 don't set off the extra request.

I don't have any immediate fix but the problem is certainly an efficiency problem and in our case where we "pay" for every map request, it is also 3 times as costly.

Change History

10/03/07 07:40:28 changed by crschmidt

  • priority changed from minor to major.
  • milestone set to 2.6 Release.

I highly recommend not using URLs that long. I believe internet explorer will choke on anything over 2048 characters, which is obviously going to be a problem in more ways than paying more for requests.

We'll investigate this for 2.6 -- patches welcome, of course -- but it's too late to make it a blocker for 2.5.

12/02/07 15:48:18 changed by crschmidt

  • description changed.
  • milestone changed from 2.6 Release to Future.

I can't find anything that would cause this explicitly, and I don't have a plan to work on a fix. Bumping to future until someone indicates they're working on it.