The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Datastore cache to WinCache - boost your vBulletin Details »» | |||||||||||||||||||||||||||||
Datastore cache to WinCache - boost your vBulletin
Developer Last Online: Sep 2013
Also see: Wincache for vb 4.0.2
This allows you to use WinCache as a datastore cache in vBulletin. This also assumes that you have already installed Wincache version 1.1 or later. This is definitely your choice if you have already installed and enabled WinCache on your IIS server. Use at your own risk! (See screenshot of stats below after 30mins up-time) Prerequisites
Code:
// ############################################################################# // WINCACHE /** * Class for fetching and initializing the vBulletin datastore from WINCACHE */ class vB_Datastore_WINCACHE extends vB_Datastore { /** * Indicates if the result of a call to the register function should store the value in memory * * @var boolean */ var $store_result = false; /** * Fetches the contents of the datastore from WINCACHE * * @param array Array of items to fetch from the datastore * * @return void */ function fetch($itemarray) { if (!function_exists('wincache_ucache_get')) { trigger_error('WINCACHE not installed', E_USER_ERROR); } $db =& $this->dbobject; $itemlist = array(); foreach ($this->defaultitems AS $item) { $this->do_fetch($item, $itemlist); } if (is_array($itemarray)) { foreach ($itemarray AS $item) { $this->do_fetch($item, $itemlist); } } $this->store_result = true; // some of the items we are looking for were not found, lets get them in one go if (!empty($itemlist)) { $this->do_db_fetch(implode(',', $itemlist)); } $this->check_options(); // set the version number variable $this->registry->versionnumber =& $this->registry->options['templateversion']; } /** * Fetches the data from shared memory and detects errors * * @param string title of the datastore item * @param array A reference to an array of items that failed and need to fetched from the database * * @return boolean */ function do_fetch($title, &$itemlist) { $ptitle = $this->prefix . $title; if (($data = wincache_ucache_get($ptitle)) === false) { // appears its not there, lets grab the data, lock the shared memory and put it in $itemlist[] = "'" . $this->dbobject->escape_string($title) . "'"; return false; } $this->register($title, $data); return true; } /** * Sorts the data returned from the cache and places it into appropriate places * * @param string The name of the data item to be processed * @param mixed The data associated with the title * * @return void */ function register($title, $data, $unserialize_detect = 2) { if ($this->store_result === true) { $this->build($title, $data); } parent::register($title, $data, $unserialize_detect); } /** * Updates the appropriate cache file * * @param string title of the datastore item * @param mixed The data associated with the title * * @return void */ function build($title, $data) { $ptitle = $this->prefix . $title; //The below line is not required as wincache_ucache_set will override the data if it is already present //wincache_ucache_delete($ptitle); wincache_ucache_set($ptitle, $data); } } Code:
$config['Datastore']['class'] = 'vB_Datastore_WINCACHE'; Check the "User and Session Cache" section of your wincache.php (screenshot) in your browser to see stats! Special thanks to the guys at Microsoft for their help! Official IIS support at http://forums.iis.net Enjoy! Screenshots
Show Your Support
|
Comments |
#12
|
|||
|
|||
|
#13
|
|||
|
|||
|
#14
|
||||
|
||||
Why do you recommend V1.1 or higher when it is a beta release. Shouldn't 1.0 work as well since that was the last stable release?
|
#15
|
|||
|
|||
Use version 1.0 and let me know how that works out for you.
|
#16
|
|||
|
|||
Will this mod work in a 3.7 board?
Quote:
Quote:
|
#17
|
|||
|
|||
I never tested 3.7. Don't know if it works.
Upgrade the speed is worth it |
#18
|
|||
|
|||
|
#19
|
|||
|
|||
Thanks im using this all installed, hope it improves the board.
|
#20
|
|||
|
|||
I just tried it out, and I can confirm that it does not work with my 3.7 board.
|
#21
|
||||
|
||||
I installed this mod and I dont see "User and Session Cache" tab on my wincache.php and i have the latest Wincache installed.
P.S. I found out i had to manually enable the user cache, but doing so still doesnt display the user cache tab. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|