Changes between Version 1 and Version 2 of VCLExampleCachingLoggedInUsers


Ignore:
Timestamp:
2009-09-28 10:28:11 (5 years ago)
Author:
kane
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VCLExampleCachingLoggedInUsers

    v1 v2  
    11= Caching logged in users = 
    22 
    3 One of the hardest things to get right when caching, is to be able to cache content for logged in users. 
     3One of the hardest things to get right when caching, is to be able to cache content for logged in or cookied users. 
    44 
    55The below snippets of code show you how to do this with varnish, using '''vcl_hash''' and '''esi'''. 
     6 
     7Here is what you need in your setup to make this work: 
     8 
     9  * A value in your cookie that unique defines your user. 
     10    * This can be a '''session''' key if you let your cache expire  
     11    * This should be a '''UUID''' if you do '''not''' let your cache expire, but purge manually instead. 
     12  * A predictable identifier in your '''esi''' calls to indicate what content is state specific, and which is not 
     13    * This let's varnish do the right thing, without needing to know anything about your application 
     14    * Since you control the ESI urls, and the user never sees them, any markers are safe