I think that the implementation for getting the web_src used in esi.js can be improved, and for my implementation, has to be changed. In esi.theme.inc::theme_esi_tag there exists code to set Drupal.settings.esi. I don't think this is required and frankly might incur a slight overhead. I request that the code that invokes the settings include (occurrences of:

<?php
drupal_add_js
(array('esi' => array($css_id => $ajax_src)), 'setting');
?>

be removed, and that in esi.js these lines:
if (Drupal.settings.esi[css_id] == 'undefined') {
      return;
    }
    var web_src = Drupal.settings.esi[css_id];

be replaced with this:
var web_src = $("esi\\:include").attr('src');

Currently I don't see a reason to use the Drupal.settings.esi method, and I think that probably the reason that that method was used was because of the percieved inability to target the tag. Ideas?

Comments

Source of the js code: #1326104: Add ajax option and configurable defaults

The reason that that method was used was because of the perceived inability to target the tag.

That's probably a correct guess.

Create a patch and/or start a sandbox :)

The 7.x branch is using the jQuery ESI plugin to provide an AJAX fallback…it could probably be back-ported to 6.x-2.x too.

Title:Remove Drupal.settings.esi codeChange the 6.x-2.x ajax rendering to avoid using tag identifiers in Drupal.settings.esi

Issue summary:View changes

Changed 'Currently I don't see a reason to use your method' to 'Currently I don't see a reason to use the Drupal.settings.esi method'