My biggest script-related performance hit is waiting for my ad server. Advertisements are served on my website through javascript placed in blocks. Javascript in blocks and in template files does not seem to be handled by headjs. Is there any technique I can try to have headjs handle the downloading of these block-based scripts as well?

Comments

alexweber’s picture

Version: 7.x-0.x-dev » 6.x-1.x-dev
Status: Active » Needs review

There are 2 possibilities:

1 - I could add a feature to the headjs module to rewrite script tags found in blocks (and elsewhere) - the problem with this is that it is messy and all the regexes could adversely impact performance
2 - You add the javascript manually using drupal_add_js() or drupal_set_html_head() instead of putting it inline in the block

I realize that in Drupal 6 its limited because drupal_add_js() doesn't work with external files.

I guess what I can try to do is rewrite script tags only in the document's head (added by drupal_set_html_head())

How does that sound?

alexweber’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » alexweber
Category: support » feature

fixed in dev version, please wait for automatically generated snapshot or beta release later on today!

alexweber’s picture

Status: Needs review » Closed (fixed)

closing due to 2 weeks of inactivity