You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joris Vankerschaver <Jo...@ugent.be> on 2003/10/04 20:49:26 UTC

[users@httpd] Re: users Digest 3 Oct 2003 01:21:50 -0000 Issue 1216

users-digest-help@httpd.apache.org wrote:

 > I'm not at all sure why you'd want to do it this way... funky is
 > indeed apropos.

OK, I should have explained some more.  I have a webpage with news and 
some where people can leave messages.  These pages change often, but 
usually once the page is created, it doesn't change for some time... 
Therefore it seemed like a big waste of time to get the data from the 
database every time a user requests this page.  Instead, there's no 
page, but the first user to access it generates a 404 error, which is 
caught by the script mentioned in my .htaccess file and this script then 
regenerates the page.  As you say, I have a cronjob cleaning out the 
cache, and also some scripts marking pages in the cache as dirty once 
someone makes an addition...

It's indeed not much of a nice solution, but I was tinkering with it 
nevertheless, to see how it worked.

 > If I understand correctly, every time a page is found missing, you're
 > checking if there's a cache page in existence that says it doesn't
 > exist, if not, you're creating a new page on the disk that says it
 > doesn't exist, then doing a redirection to that newly created page?
 > Why use the .htaccess files?  This I'm not too clean on.  I'm also not
 > too familiar with (or fond of?) the technique of using readable files
 > underneath a cgi-bin, usually you don't want them readable, they're
 > going to be executable, and the server will treat them as programs.

I don't quite understand what you mean by 'readable files underneath a 
cgi-bin'...

 > If I were approaching the problem of an 404 error handler, I'd
 > probably create a template page, read it into my perl script, swap
 > patterns (anchors in the template) with replacement data (URL that was
 > missing), and output to browser.  With caching, you've got to have
 > some sort of cron job to run a script to handle cache cleaning
 > periodically.  Sometimes a simpler solution leads to less headaches in
 > troubleshooting.

You're right.  Moreover my page is never going to attract that much 
people so this elaborate mechanism of caching is somehow overkill... 
It's just something to brag about to other web-geeks :)

The people I've checked with all let the cgi-script read the freshly 
generated page instead of outputting some redirection code.  Maybe I 
should do that too...

I'm still curious about why Apache treats the script differently when 
it's called in the context of the .htaccess file, though.


Thx,

Joris Vankerschaver



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org