diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-06-28 16:24:51 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-06-28 16:24:51 -0700 |
commit | aa31e1f0090522c3cfb3a44b947ad8c33a275979 (patch) | |
tree | 0438427a2864b69228a48ff6670671d53ee7cf17 /modules/gallery/helpers | |
parent | f3f8b5eed6bbb4a1697db2ac5a7085439ed35a0d (diff) |
Tweak the cache implementation
1) Drop the *_modified key, we don't really need it. The modification date is not
relevant to our browser caching strategy.
2) Fix multiple issues with the Expires header and just hardcode it to the biggest
possibly value for code clarity.
3) print the $content out directly instead of using fwrite
4) Minor cleanups in the installer.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 8ccbd51b..d0bfa629 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -32,6 +32,15 @@ class gallery_installer { PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {caches} ( + `id` varchar(255) NOT NULL, + `tags` varchar(255), + `expiration` int(9) NOT NULL, + `cache` longblob, + PRIMARY KEY (`id`), + KEY (`tags`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE {graphics_rules} ( `id` int(9) NOT NULL auto_increment, `active` BOOLEAN default 0, @@ -181,15 +190,6 @@ class gallery_installer { UNIQUE KEY(`module_name`, `name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - $db->query("CREATE TABLE {caches} ( - `id` varchar(255) NOT NULL, - `tags` varchar(255), - `expiration` int(9) NOT NULL, - `cache` longblob, - PRIMARY KEY (`id`), - KEY (`tags`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - foreach (array("albums", "logs", "modules", "resizes", "thumbs", "tmp", "uploads") as $dir) { @mkdir(VARPATH . $dir); } @@ -278,13 +278,13 @@ class gallery_installer { if ($version == 3) { $db->query("CREATE TABLE {caches} ( - `id` varchar(255) NOT NULL, - `tags` varchar(255), - `expiration` int(9) NOT NULL, - `cache` text, - PRIMARY KEY (`id`), - KEY (`tags`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + `id` varchar(255) NOT NULL, + `tags` varchar(255), + `expiration` int(9) NOT NULL, + `cache` text, + PRIMARY KEY (`id`), + KEY (`tags`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); module::set_version("gallery", $version = 4); } if ($version == 4) { |