Forum Moderators: phranque

Message Too Old, No Replies

html linked JS files loading very slow

JS relative links load slow, but if you load directly through URL no issue

         

willis1480

10:35 pm on Jan 5, 2010 (gmt 0)

10+ Year Member



So I am having a peculiar issue.

My html file will load very quick, under 1 second. However my linked js file will take upwards of 15 seconds for 244 bytes (yes, bytes, not KB).

however, if I take the linked JS file url and put it in the browser directly, under 1 second load time. Also, browsers are not caching this file.

using firebug and chrome developer tools for measuring download times.

Doesnt seem to be a server issue (even though Im posting here) because I can download quickly via direct url, but really baffled at how this can be an HTML issue.

Any ideas?

PM me and I send you links. Here is my HTML script tag:


<script language="javascript" type="text/javascript" src="http://?.com/templates/buttons/cssButtons/cssBtn.js" ></script>

(seems css files link fine).

willis1480

11:38 pm on Jan 6, 2010 (gmt 0)

10+ Year Member



well after too much bafflement I discovered the issue. Apparently the file had just "gone bad". Not sure what happened still, but copying the file as a new filename fixed the issue. Really have no clue to what happened by it is resolved.

jdMorgan

7:49 am on Jan 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad to hear you found a fix... I stared at this thread several times, but drew a total blank.

Jim

willis1480

3:48 pm on Jan 7, 2010 (gmt 0)

10+ Year Member



I wouldnt say I really solved it. I found a work around, but I am still baffled. I looked at header information to try and understand if there was something weird there, but didnt see anything strange.

Ive had files go "bad" on my server before just randomly...which is the only reason I thought to try this....still doesnt make a whole lot of sense, must have been a mime type issue or something.

jdMorgan

8:21 pm on Jan 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the editor that you use to create/modify the file is capable of outputting several character-coding formats such as ASCII and UTF-16, then perhaps the MIME-type could have disagreed with the actual content. I don't know how that would 'change all by itself' or why 'it would work' after a long delay, though...

Jim