Re: [users@httpd] Rfi (Request for ideas ;-)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/31/05, Alexander Lazic <al-httpdusers@xxxxxxx> wrote:
> The webserver apache is configured to prevent calls to the app-tier
> by serving html-Files if they can be found locally on the webserver.
>
> Otherwise (if the Files do not exist locally) the request-url will be
> changed (file-extension to application-server-extension) and
> passed-through to the app-tier.
>
>
> Our solution at the moment is:
> .
> RewriteCond %{DOCUMENT_ROOT}/index\.html !-s
> RewriteRule /index\.html /index\.jsp [PT]
>
> I think there is a 'better' solution out there, isn't it?
>
> I assume that these conditions make apache a little bit slower, because
> apache looks on every request on the disk, we have 23 of these
> statements.
>
> Does anybody have some nice ideas to prevent that many *stat() calls?

Note that this is not as bad as it looks, because mod_rewrite
evaluates the RewriteRule BEFORE the RewriteCond, so the stat will
only happen in the above example if the request is for /index.html.

As Nick mentioned, the best way to handle this is to find some
characteristic of the request that differentiates local and back-end
content.  If the only such characteristic is the existence of the file
on the disk, then obviously, you can't avoid at least one stat.

One alternative might be to rethink your architecture a little.  You
could put all the content (including the static stuff) on the back-end
server, and put apache with mod_cache in front.  Then provided that
the back-end server sends proper cache-control information, you will
almost never touch the back-end server on the cachable static content.

Joshua.

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux