vBulletin - Page Caching Woes
Sun
27
Jan
2008
It is almost a month now since the migration of CGPainting.com from SMF to vBulletin. And ever since the migration, there was this problem of the thread list not getting updated unless you hit the refresh button on the browser.
The particular vBulletin option called Server Settings and Optimization Options had twoconfiguration in it:
- Update Thread Views Immediately
- Update Attachment Views Immediately
I had set both of them to "Yes" but that did not solve the issue.
Problem
This could be replicated for Ubuntu + FireFox, Windows Vista + (FireFox / Opera / IE7) and, Windows XP + IE6. The problem occured in several places like the PM screen, the 'Online Members' screen, and even in the Admin CP of vBulletin. The problem was for all the members, and even after clearing the browser cache and cookies, it persisted. The problem is better explained by one of our new forum member.
The vBulletin staff were timely to reply to my support ticket, but it was a long process of getting them understand what the problem was. After setting the forum back to the original default style, and disabling all plugins, the problem could not be fixed.
The particular vBulletin staff threw the towe, stating that it is a problem with the server cache settings, but not much detail to that.
Parallely I have been trying to get some help from my webhost. I tried to find out if there were any cache settings in the server as I too suspected this was the issue. Not much information could be got from them either.
Solution
After some research (read gnawing at my nails and pulling out my hair), I got hold of the documentation on Apache modules. The particular module called mod_expires held the key to the solution.
The nifty little phpinfo() function let me make sure that this particular module was active in the Apache configuration of the server I was hosted it. I could not get information on how it was set at the root server level. But that does not matter, as we can override the configuration using .htaccess.
As stated in the documentation for ExpiresActive directive, all I had to do was add the following to the .htaccess of cgpainting.com folder.
ExipresActive Off
Yes, that was as simple as that. The mod_expires can be used to define the expiry features of the URLs of a particular domain. This module (sometimes along with mod_headers) is used for caching purposes. But for a dynamic site as a forum, it does not make sense where the content will be changing every now and then. Hence, I use the directive to switch it off and not cache any pages at CGPainting.com.
Note that this would increase the server load, and would need to be fine tuned by switching off the caching to only specific sections of the forum. Hence, I will have to put the standard disclaimer of 'use the solution at your own risk'.
Post new comment