Index: branches/5.1.x/core/install/upgrades.sql
===================================================================
diff -u -r13161 -r13168
--- branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13161)
+++ branches/5.1.x/core/install/upgrades.sql	(.../upgrades.sql)	(revision 13168)
@@ -1652,3 +1652,33 @@
 DELETE FROM PersistantSessionData WHERE VariableName = 'phrases_columns_.';
 
 UPDATE Category SET FormId = NULL WHERE FormId = 0;
+
+INSERT INTO ConfigurationAdmin VALUES ('MemcacheServers', 'la_section_SettingsCaching', 'la_config_MemcacheServers', 'text', '', '', 80.01, 0, 0);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'MemcacheServers', 'localhost:11211', 'In-Portal', 'in-portal:configure_advanced');
+
+ALTER TABLE Category
+	ADD EnablePageCache TINYINT NOT NULL DEFAULT '0',
+	ADD OverridePageCacheKey TINYINT NOT NULL DEFAULT '0',
+	ADD PageCacheKey VARCHAR(255) NOT NULL DEFAULT '',
+	ADD PageExpiration INT NULL DEFAULT NULL ,
+	ADD INDEX (EnablePageCache),
+	ADD INDEX (OverridePageCacheKey),
+	ADD INDEX (PageExpiration);
+
+DELETE FROM Cache WHERE VarName LIKE 'mod_rw_%';
+
+CREATE TABLE CachedUrls (
+  UrlId int(11) NOT NULL AUTO_INCREMENT,
+  Url varchar(255) NOT NULL DEFAULT '',
+  `Hash` int(11) NOT NULL DEFAULT '0',
+  Prefixes varchar(255) NOT NULL DEFAULT '',
+  ParsedVars text NOT NULL,
+  Cached int(10) unsigned DEFAULT NULL,
+  LifeTime int(11) NOT NULL DEFAULT '-1',
+  PRIMARY KEY (UrlId),
+  KEY Url (Url),
+  KEY `Hash` (`Hash`),
+  KEY Prefixes (Prefixes),
+  KEY Cached (Cached),
+  KEY LifeTime (LifeTime)
+);
\ No newline at end of file
