Javascripts & Sym Links vs. Cache Engines & Proxy Servers

Javascripts & Sym Links vs. Cache Engines & Proxy Servers

Post by Dan Poyn » Sat, 24 Jul 1999 04:00:00



I think of the cache engines like robots, but they don't seem to obey
robots.txt rules. It's annoying me and my server stats that they are not
recognizing my symbolic links like a browser does and are attempting to
read my Javascripts links out of context , thus running amok looking for
non existing documents and causing thousands of unnecessary lookups on my
server each day.

Specifically...
I'm rotating my web site content by changing a symbolic link, named
"current", to a different directory (slideshows/dir0100/,
slideshows/dir0200/, ...) each hour.

On my index.html when a user clicks to enter the "current" content
directory they load current/index.html which has a Javascript function
which looks something like this:

function runShow() {
   blah,blah,blah
   show_tour("../slideshows/dir1000/01.html");
   blah,blah,blah
   show_tour("../slideshows/dir1000/02.html");
   blah,blah,blah
   show_tour("../slideshows/dir1000/03.html");
   blah,blah,blah
   }

To avoid current/index.html from being cached, so users see the new
content, I use that path:
"../slideshows/dir1000/01.html" in the scripts, which is backing up one
level from the "current" directory and looking in the appropriate
slideshows subdirectory for content pages.

Otherwise placing <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> before my
Javascripts in the html pages doesn't help. I'm not aware of any equivalent
no-cache command I might use in the actual Javascript <script> tags
themselves.

When the page loads in a web browser it thinks it's looking at a directory
named "current" and everything works great. I've tested this on multiple
platforms with various browsers to insure compatibility. So it's not a
WebTV thing or something like that.

It seems the cache engines break out of my symbolicly linked  "current"
directory and I see lots of requests in my Apache error_logs to load things
like:
[Fri Jul 23 15:58:06 1999] [error] [client 209.148.145.47] File does not
exist: /home/httpd/foobar.com/slideshows/slideshows/dir1000/02.html
[Fri Jul 23 15:58:12 1999] [error] [client 209.148.145.47] File does not
exist:
/home/httpd/foobar.com/slideshows/slideshows/slideshows/dir1000/03.html
[Fri Jul 23 15:58:21 1999] [error] [client 209.148.145.47] File does not
exist:
/home/httpd/foobar.com/slideshows/slideshows/slideshows/slideshows/dir1000/0
4.html
etc...
which adds a lot of unnecessary traffic trying to find pages such as:
slideshows/slideshows/slideshows/slideshows/slideshows/slideshows/slideshows
/slideshows/slideshows/slideshows/slideshows/slideshows/slideshows/slideshow
s/slideshows/slideshows/slideshows/slideshows/slideshows/slideshows/slidesho
ws/slideshows/slideshows/slideshows/dir1000/50.html

specs: Linux RH5.2 server with Apache 1.3.6.

Any thoughts to avoid such problems would be much appreciated.

Thanks,
DAN