Javascript – sIFR Cause initial page load to stall

apachejavascriptsifr

I just recently launched my blog, and I think that sIFR is causing intial page loads to stall, basically causing an internal 500 error or timeout.

The URL for the site is http://gothamblack.com/

For the life of me, I cannot determine what is going on. I am currently running the latest version of sIFR, with the replacement of the parseSelector to use "$" to leverage jQuery. Other details are: Expression Engine CMS, Mint stats, and a modified htaccess to compress files (which might be another issue if it conflicts? but I don't see how).

I relocated the sIFR replacement calls to a global.js file to minimize the file requests, and that is called last in the stream. My JS files are at the following:

modified sifr min with parseSelector: http://gothamblack.com/source/scripts/sifr.js
global javascript file: http://gothamblack.com/source/scripts/global.js

The modified htaccess file has the following commands:


# Set Language and Character Set
AddDefaultCharset utf-8
AddLanguage en-gb .en
# Cache images and set default on everything else
ExpiresActive on
ExpiresDefault A259200
ExpiresByType image/gif A1209600
ExpiresByType image/png A1209600
ExpiresByType image/jpeg A1209600
# Set css and js so they can be gzipped
<IfModule mod_mime.c>
AddType application/x-httpd-php .css
AddType application/x-httpd-php .js
</IfModule>
# Expression Engine related
Options +FollowSymLinks
RewriteEngine On
# site routing
RewriteCond %{HTTP_HOST} ^www\.gothamblack\.com$ [NC]
RewriteRule ^(.*)$ http://gothamblack.com/$1 [L,R=301]
# Expression Engine related routing
RewriteCond $1 !^(enginecore|feeder|images|mint|source|themes|favicon\.ico|robots\.txt|index\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]

If anyone has ANY ideas as to what I can do to troubleshoot this, that would be greatly appreciated. I tried looking at firebug when the page loads, but I cannot seem to pinpoint what it is spinning its wheels on when there is a stall.

Thanks again for the help!

Best Answer

Could you try removing Mint?

Regarding the sIFR setup: You must call sIFR.activate() directly from JavaScript, not from any onload events. You can also put some shared properties (like ratios) on the font objects. I don't think your complicated switch() statement is necessary either — sIFR won't fail if something isn't in the DOM.