# Re: Multiple caching solutions for anonymous and logged in users with SSI on

**URL:** <https://www.ruby-forum.com/t/re-multiple-caching-solutions-for-anonymous-and-logged-in-users-with-ssi-on/217601>\
**Category:** NGINX\
**Created:** [March 6, 2012, 12:20pm UTC](https://www.ruby-forum.com/t/re-multiple-caching-solutions-for-anonymous-and-logged-in-users-with-ssi-on/217601 "2012-03-06T12:20:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 6, 2012, 12:20pm UTC](https://www.ruby-forum.com/t/re-multiple-caching-solutions-for-anonymous-and-logged-in-users-with-ssi-on/217601/1 "2012-03-06T12:20:26Z")

</div>

> Bird brain me 🙂
> 
> What does this mean?
> 
> ~SESS[[:alnum:]]+=(?\<session\_id\>[[:graph:]]+) $session\_id;

It means to grab the sub-token on the right-hand side of the session  
token.  
Using POSIX character classes for the regex:

> **[Regular expression](https://en.wikipedia.org/wiki/Regular_expression#POSIX_character_classes)**
>
> A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a match pattern in text. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. Regular expression techniques are developed in theoretical computer science and formal language theory.
> The concept of regular expressions began in the 1950s, when the American mathematician ...

> Also ‘if’ is evil inside a location. Right ?

Not really. Here it’s a mere return. From the famous IfIsEvil wiki page:

```
 The only 100% safe things which may be done inside
 if in location context are:

       return ...;
       rewrite ... last;

```

–appa

---

<div class="post-metadata">

**Author:** ![Antonio\_P.PSAlmeid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Antonio\_P.PSAlmeid](https://www.ruby-forum.com/u/Antonio_P.PSAlmeid)\
**Post date:** [March 6, 2012, 12:55pm UTC](https://www.ruby-forum.com/t/re-multiple-caching-solutions-for-anonymous-and-logged-in-users-with-ssi-on/217601/2 "2012-03-06T12:55:50Z")

</div>

Thanks a lot!  
If I instruct nginx to cache a page and if it has ssi tags, will it  
still  
go to the back-end to retrieve?

---

<div class="post-metadata">

**Author:** ![Antonio\_P.PSAlmeid](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@Antonio\_P.PSAlmeid](https://www.ruby-forum.com/u/Antonio_P.PSAlmeid)\
**Post date:** [March 6, 2012, 1:12pm UTC](https://www.ruby-forum.com/t/re-multiple-caching-solutions-for-anonymous-and-logged-in-users-with-ssi-on/217601/3 "2012-03-06T13:12:34Z")

</div>

> Thanks a lot!  
> If I instruct nginx to cache a page and if it has ssi tags, will it still  
> go to the back-end to retrieve?

AFAIK yes. That shouldn’t introduce any issue. Nginx has support for SSI  
also and you can implement a caching system taking advantage of it. But  
it  
requires you to split your page in multiple parts.

–appa
