We have moved to Github. Please open tickets there.

Opened 17 months ago

Last modified 12 months ago

#4207 new Defect

Adapt start.php to multisite caches

Reported by: fabcol Owned by:
Priority: normal Milestone: Long Term Discussion
Component: Core Version: 1.8.1
Severity: major Keywords: multisite, cache
Cc: brett@… Difficulty:

Description (last modified by ewinslow)

engine/start.php should be adapted to implement different caches depending on the site_guid on the site you are currently running

this is my code :

(should be set after the boot, system to be abble to get a site_guid value)

// needs to be set for links in html head
//Multisite add site_guid to datalist variables
$id=$CONFIG->site->guid;

$viewtype = get_input('view', 'default');
$lastcached = datalist_get("simplecache_lastcached_".$id."_".$viewtype);
$CONFIG->lastcache = $lastcached;

// Regenerate the simple cache if expired.
// Don't do it on upgrade because upgrade does it itself.
// @todo - move into function and perhaps run off init system event

if (!defined('UPGRADING')) {
	$lastupdate = datalist_get("simplecache_lastupdate_".$id."_".$viewtype);
	$lastcached = datalist_get("simplecache_lastcached_".$id."_".$viewtype);
	if ($lastupdate == 0 || $lastcached < $lastupdate) {
		elgg_regenerate_simplecache($viewtype);
		$lastcached = datalist_get("simplecache_lastcached_".$id."_".$viewtype);
	}
	$CONFIG->lastcache = $lastcached;

Change History (2)

comment:1 Changed 17 months ago by cash

  • Description modified (diff)

comment:2 Changed 12 months ago by ewinslow

  • Description modified (diff)
  • Milestone changed from Needs Review to Long Term Discussion

I'm not really clear on what our multisite plan is, to be honest.

Note: See TracTickets for help on using tickets.