Further improvements in caching. The state of the cache is now persisted in DB. This persists the cache between server restarts.

This commit is contained in:
Tomas Bures 2019-04-22 11:41:37 +02:00
parent 7bcd6c60e9
commit ef0464bbc9
8 changed files with 155 additions and 75 deletions

View file

@ -0,0 +1,15 @@
exports.up = (knex, Promise) => (async() => {
await knex.schema.raw('CREATE TABLE `file_cache` (\n' +
' `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n' +
' `type` varchar(255) NOT NULL,\n' +
' `url` text NOT NULL,\n' +
' `mimetype` varchar(255) DEFAULT NULL,\n' +
' `size` int(11) DEFAULT NULL,\n' +
' `created` timestamp NOT NULL DEFAULT current_timestamp(),\n' +
' PRIMARY KEY (`id`),\n' +
' KEY `url` (`url`(191))\n' +
') ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;');
})();
exports.down = (knex, Promise) => (async() => {
})();