Re: output compression when host has disabled mod_deflate, mod_gzip and php_value auto_prepend_file

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

 




On 9/21/2012 10:10 AM, edward eric pedersson wrote:
> 1) Will apache cache the full url or the url minus the query parameter?

I don't believe that Apache will cache anything. Did you mean the
user-agent? If so, the user-agent should cache the contents associated
with the entire URL, including the query-string. After all, the
query-string is part of the URL and a one-character change in the
query-string means an entirely different (and potentially unrelated) URL.

> 2) Are there any performance benefits as there is an overhead in
> calling the PHP file?

There are definitely no performance benefits. Did you mean performance
penalties? :)

There are definitely penalties; to what extent they affect your
application depends on how "heavy" the PHP wrapper script is. For
example, if you simply read the CSS file and spit it back out with
compression, it should perform fairly well.

Also, consider implementing some kind of white-list for your CSS files.
The implementation could range from a simple call to in_array() to a
database query. The goal is to prevent malicious user-agents from
requesting (and receiving) arbitrary files from the file-system.

> 3) If the PHP call is cached is it cached with the file query parameter?

Again, I don't believe Apache does any caching in the manner implied.
PHP, however, is capable of leveraging an op-code cache (such as APC).
Unfortunately, I don't know much about its inner-workings.

For what it's worth, I do this very thing (PHP wrapper script to acquire
CSS and JS files) quite successfully (although, for templating reasons,
not compression).

Good luck!

-Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: users-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