# vBulletin caching proxy

**URL:** <https://www.ruby-forum.com/t/vbulletin-caching-proxy/197835>\
**Category:** NGINX\
**Created:** [October 20, 2010, 11:52pm UTC](https://www.ruby-forum.com/t/vbulletin-caching-proxy/197835 "2010-10-20T23:52:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [October 20, 2010, 11:52pm UTC](https://www.ruby-forum.com/t/vbulletin-caching-proxy/197835/1 "2010-10-20T23:52:45Z")

</div>

Hi,

I’m trying to build similar configuration to this one  
([http://www.vbulletin.com/forum/entry.php?2440-vB4Mance-Part-5-Expert-Level-Boosting-vBulletin-Performance-with-Advanced-Caching](http://www.vbulletin.com/forum/entry.php?2440-vB4Mance-Part-5-Expert-Level-Boosting-vBulletin-Performance-with-Advanced-Caching))  
but using nginx. Aparently there is no problem caching static files and  
php generated css, but websites itselves dont cache.

Here is part config of proxy:

```auto
        proxy_pass http://ip:78;
        proxy_cache one;
        proxy_cache_key $host$request_uri;
        proxy_cache_valid 5m;
        proxy_cache_methods GET HEAD;
        proxy_no_cache $cookie_bb_imloggedin $cookie_bb_password
$cookie_bb_userid $nocache;
        proxy_ignore_headers X-Accel-Expires Expires Cache-Control;
```

This goes to cache:  
[http://ls2009.eu:8080/css.php?styleid=7&amp;langid=2&amp;d=&amp;sheet=forumhome\_sub\_forum\_manager.css](http://ls2009.eu:8080/css.php?styleid=7&amp;langid=2&amp;d=&amp;sheet=forumhome_sub_forum_manager.css)  
This doesn’t:  
[http://ls2009.eu:8080/masz-problem-z-ls-2011/37697-skoszona-trawa.html#post142777](http://ls2009.eu:8080/masz-problem-z-ls-2011/37697-skoszona-trawa.html#post142777)

I’m aware of Pragma: private and Cache-control: private, I commented it  
out from code with no results. Also Cache-control should be ignored. Anu  
ideas?

Posted at Nginx Forum:

> **[vBulletin caching proxy](https://forum.nginx.org/read.php?2,142879,142879#msg-142879)**
>
> Hi, I'm trying to build similar configuration to this one (http://www.vbulletin.com/forum/entry.php?2440-vB4Mance-Part-5-Expert-Level-Boosting-vBulletin-Performance-with-Advanced-Caching) but using nginx. Aparently there is no problem caching static...

---

<div class="post-metadata">

**Author:** ![meto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@meto](https://www.ruby-forum.com/u/meto)\
**Post date:** [October 22, 2010, 12:21pm UTC](https://www.ruby-forum.com/t/vbulletin-caching-proxy/197835/2 "2010-10-22T12:21:00Z")

</div>

I figured out that it must be something with headers. Does anybody knows  
why nginx ignores cache with those headers?

```auto
Server nginx/0.8.53
Date Fri, 22 Oct 2010 10:16:28 GMT
Content-Type text/html; charset=ISO-8859-2
Connection keep-alive
X-Powered-By PHP/5.3.3
X-Pingback http://ls2009.eu/vbseo-xmlrpc/
Set-Cookie bb_lastvisit=1287437336; expires=Sat, 22-Oct-2011 10:16:28
GMT; path=/; domain=ls2009.eu bb_lastactivity=0; expires=Sat,
22-Oct-2011 10:16:28 GMT; path=/; domain=ls2009.eu
vbseo_loggedin=deleted; expires=Thu, 22-Oct-2009 10:16:27 GMT; path=/
Cache-Control private
Pragma private
Last-Modified Wed, 20 Oct 2010 21:01:11 GMT
Vary Accept-Encoding,User-Agent
Content-Encoding gzip
Content-Length 9560
```

Cache-control should be ignored according to proxy cache settings…

Posted at Nginx Forum:

> **[Re: vBulletin caching proxy](https://forum.nginx.org/read.php?2,142879,143444#msg-143444)**
>
> Hi, I'm trying to build similar configuration to this one (http://www.vbulletin.com/forum/entry.php?2440-vB4Mance-Part-5-Expert-Level-Boosting-vBulletin-Performance-with-Advanced-Caching) but using nginx. Aparently there is no problem caching static...

---

<div class="post-metadata">

**Author:** ![meto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@meto](https://www.ruby-forum.com/u/meto)\
**Post date:** [October 22, 2010, 12:49pm UTC](https://www.ruby-forum.com/t/vbulletin-caching-proxy/197835/3 "2010-10-22T12:49:20Z")

</div>

Hello!

On Fri, Oct 22, 2010 at 06:19:45AM -0400, meto wrote:

> Set-Cookie bb\_lastvisit=1287437336; expires=Sat, 22-Oct-2011 10:16:28  
> Cache-control should be ignored according to proxy cache settings…  
> Since 0.8.44 nginx doesn’t cache by default responses with  
> Set-Cookie. If you want them to be cached you have to add  
> “proxy\_ignore\_headers Set-Cookie”.

Note well: you may also want to add “proxy\_hide\_header Set-Cookie”  
(or make sure cookies set aren’t private, or make sure your  
proxy\_cache\_key distinct for different users).

Maxim D.

---

<div class="post-metadata">

**Author:** ![meto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a9adbd/32.png) [@meto](https://www.ruby-forum.com/u/meto)\
**Post date:** [October 22, 2010, 12:59pm UTC](https://www.ruby-forum.com/t/vbulletin-caching-proxy/197835/4 "2010-10-22T12:59:24Z")

</div>

Thanks that works good. It’s by design guest cache controlled by cookie  
‘imloggedin’=1 So even if cookies are set it’s ok to be public.

PS.  
I was relying on wiki since there is no english documentation. Could you  
please make english docs as much up to date as russian?

Posted at Nginx Forum:

> **[Re: vBulletin caching proxy](https://forum.nginx.org/read.php?2,142879,143454#msg-143454)**
>
> Hi, I'm trying to build similar configuration to this one (http://www.vbulletin.com/forum/entry.php?2440-vB4Mance-Part-5-Expert-Level-Boosting-vBulletin-Performance-with-Advanced-Caching) but using nginx. Aparently there is no problem caching static...
