I might have :)

At http://sputnik.pl/dev/labs/wd/ I've put up a small fragment of an
application I am rather sure I'll forget about sooner than later, that
uses a file-based cache for HTML. I've used .htaccess to make Apache
check for the cached file without starting-up the PHP runtime:

<IfModule mod_rewrite.c>
   RewriteEngine On

   # Trailing slash fix
   RewriteCond   %{REQUEST_FILENAME} -d
   RewriteRule   ^(.+[^/])$   $1/

   # Homepage
   RewriteRule ^$   data/index.html

   # URLs with parameters are never cached
   RewriteCond %{THE_REQUEST}      \? [OR]
   RewriteCond %{REQUEST_FILENAME} !-s
   RewriteRule ^data/([^\?]*)(\?(.*))*$ data.php?__file=$1$3 [QSA,L]
</IfModule>

The rest of the code is rather uninteresting, but I can send you the
source code if you wish so. The application runs on Ajax, yet it is
rather snappy, despite the slow server it's installed on.

Besides, great most of inefficiencies in web aps are either large-scale
design problems or slow SQL queries. If I make one less bad decision
while designing an app because I'm able to tailor my CSS and Javascript
any way I want, the app will probably be just as fast as if the scripts
and styles were static.

And think of the possibilities. You could cope with browser
inconsistencies at the server, automatically serving IE code to IE's
and FF code to FF's. Instead of client-side conditionals:

      this.target =$(event.target || event.srcElement);

you can do this on your server:

      <? define('EVENT_TARGET', 'event.' . BROWSER == 'IE' ?
'srcElement': 'target')?>:
      this.target = $(<?=EVENT_TARGET?>);

I'd say that this makes code leaner and more compatibile. I for one am
going for it :)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to