Re: mod_cache, mod_deflate, mod_expires and a headache

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

 



Hi All 

Still struggling with this one :)

I've tried adding "MOD_EXPIRES" as a filter before "CACHE" but it doesn't seem to cause mod_expires to be evaluated before its cached (I don't really understand what AP_FTYPE_CONTENT_SET-2 means in the source for mod_expires) - Can what I'm trying to do be done?

Essentially, I am trying to achieve something like: 

> # Apply mod_expires config to all output BEFORE hitting mod_cache - Then cache the output
> # Doing this ensures correct cache control headers are in place by mod_expires prior to mod_cache doing its thing
>
>  SetOutputFilter MOD_EXPIRES;CACHE
>
> # pass through mod_deflate after everything else is done for text content
>  AddOutputFilterByType DEFLATE text/html text/plain text/css application/_javascript_ application/rss+xml



Kind Regards, 
Simon


On 1 June 2016 at 19:41, Simon Mott <dementedidiot@xxxxxxxxx> wrote:
Hi Eric

Thanks for getting back to me. So if there is no mime type when it wants to cache which is why the AddOutputFilterType CACHE filter isn't doing what I expect, but SetOutputFilter CACHE gets caching before compression correct, is there any way I can apply mod_expires and mod_headers before passing to be cached also? This ensures that correct cache control headers are used prior to being dealt with by mod_cache

Currently with:

>  SetOutputFilter CACHE
>  AddOutputFilterByType DEFLATE text/html text/plain text/css application/_javascript_ application/rss+xml

output is being cached BEFORE mod_expires adds its headers so its not adhering to content expiry times.

Essentially I want Apache to do everything it needs to in order to generate content (uncompressed, so as to not maintain multiple copies of content based on the "Vary" header), then cache it and finally gzip it before it goes out if the client supports gzip via mod_deflate

Is this something that can be achieved or does it require modification of modules?

Thanks

On 1 June 2016 at 16:34, Eric Covener <covener@xxxxxxxxx> wrote:
I think the absence of AH00758 in the AddOutputFilterByType case is
due to no mimetype being available early enough in processing to allow
"CACHE" to be replaced by the actual caching filters when mod_cache
wants to do it.  It makes sense that no types would be available in
the early "handler" mod_cache uses to both serve from the cache and
setup caching when there's a miss.

Sounds like the doc needs improvement.

---------------------------------------------------------------------
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