Forum Moderators: phranque
My question is, could it be this file is simply not being cached, and if so, how can I force caching of this file? How can I test this principal?
The alternative is of course, that it's being hotlinked, but I can't imagine someone would want to do this as it is an obfuscated set of JS functions that are custom designed for this site.
What else would be causing such a high request rate for this one file? I'm reviewing the list of referrers, and I found a couple that are attempting to hotlink images, but I can't see someone trying to use this JS code on their own site...
BTW, the htaccess only has anti-hotlinking for images, I need to get a rule into place for JS / CSS files anyway I suppose.
Check your raw server logs, they should be located 1 directory down from your public_html folder... probibly named something like "logs"... inside there should be 2 files, 1 named something like access and one named something like error.
Open the access file, (it is just a plain text file so notepad or something similar can open it) then do a "find" for the name of the JS file, then look at the line and it will show what page requested it, what ip and so on. Look up a bunch of them and see if there is a trend that explains the high amount of times it has been called.
If you have questions about finding the file or what you are seeing with the file open, post back here.
The access log dates back to October '09, BTW.
i.e. is it actually a script element with a src= attribute requesting an external js file from your server?
Oh yes. It's all static markup with the JS script element near the bottom of the body so it loads after the page has loaded. The server-side script (PHP) includes two static markup files: the head and the 'tail' (anything after the main content), and anything in the middle is dynamically produced based on the request. The JS script element lives in the 'tail'. The markup is HTML4 and it validates.
To clarify, it's not an "external" script as in "external to this domain", but it is external to the document. In other words, it's in a local directory with the other JS libraries, it's not being requested from Google or some other server.