This forum has been moved here:
Helicon Tech Community Forum

Helicon Ape (Forum Locked Forum Locked)
 Helicon Tech : Helicon Ape
Subject Topic: mod_cache and session variables
Author
Message |
jodyg
Newbie


Joined: 05 March 2011
Posts: 2
Posted: 05 March 2011 at 4:16am

Hi,

apologies if this has been asked before.
Is it possible to use mod_cache and mod_disk_cache based on
session variable?
I'd like to cache pages to disk on our site for users that
haven't logged in, which can be determined by a session
variable.

Cheers
Back to Top
 
Vyacheslav
Admin Group


Joined: 02 July 2008
Location: Ukraine
Posts: 1542
Posted: 05 March 2011 at 9:02pm

Hello.
You may use cookies:
Code:
SetEnvIfNoCase Cookie mycookie cache-enable=mem


If “Cookie” header contains “mycookie” memory cache will be enabled. Same for disk cache:

Code:
SetEnvIfNoCase Cookie mycookie cache-enable=disk


It is also possible to enable cache when required cookie isn’t present:
Code:
SetEnvIfNoCase Cookie ^(?!mycookie).*$ cache-enable=mem


__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top Visit Vyacheslav's Homepage
 
Yaroslav
Admin Group


Joined: 15 August 2002
Posts: 6520
Posted: 06 March 2011 at 7:11am

I guess you where asking about CacheVaryByParams and CacheVaryByHeaders directives: http://www.helicontech.com/ape/doc/mod_cache.htm#CacheVaryByParams

__________________
Yaroslav Govorunov,
Helicon Tech
Back to Top Visit Yaroslav's Homepage
 
jodyg
Newbie


Joined: 05 March 2011
Posts: 2
Posted: 07 March 2011 at 2:20am

Hi,
that sounds perfect, sadly I've just come across the caveats with IIS 6 and mod_cache, we are running IIS 6 so
I'll have to see if we can either find another way of
achieving this with IIS 6 or get budget approval to
upgrade.
Thanks for the quick responses though!
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version