I see, that is something I am a bit concerned about, if a gallery has
100 images, then I have to do up to 400 file_exists (50 for thumbs, 50
for main, 50 for lightbox, 50 for lightbox thumbs) to simply display a
gallery.

I think file_exists takes about .5 of a millisecond, so it could add
on up to 200 milliseconds, which is bearable, but not desirable.

I think trying to store what images have been made/deleted in the
database would get pretty untidy, so I can see how a 404 handler works
nicely here.

I think ultimately its more of a CMS question then. A lot of my Joomla
customers don't even have htaccess.txt changed to .htaccess, and if
there is some url rewriting being done, it could be one of many
different plugins, which I will have to test and work with.

It might be best to investigate a 404 handler in the next version, but
still have the if(file_exists) to fall back on.

On Jan 13, 7:54 pm, Mal <[email protected]> wrote:
> On Jan 13, 12:37 pm, matt_thomson <[email protected]> wrote:
>
> > It seems my if(! file_exists($filePath){
> > //make file
> > //write html}
>
> > else{
> > //write html}
>
> > does what the 404 handler does, but without having to use mod_rewrite
> > and a 404 handler (and doesn't require getting Graphic Designer
> > Customers to find and edit their .htaccess file!).
>
> Yup pretty much.  The 404 method has an important performance gain
> though.  If the file has already been generated, the web server serves
> it conventionally, without firing up a PHP interpretor.  And
> presumably the derivative file will be generated once and served many
> times.
>
> Malc
-- 
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]

Reply via email to