I did mean the user-agent caching. I guess I can control this using the PHP header output and hope the user-agent respects the header.
Essentially I need to compare the cost of the two statements below assuming a 20K - 50K file
On 21 September 2012 15:57, Ben Johnson <
ben@xxxxxxxxxxxxxxxx> wrote:
>
>
> 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>
--
-- e