diff options
Diffstat (limited to 'caches/SQLiteCache.php')
-rw-r--r-- | caches/SQLiteCache.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/caches/SQLiteCache.php b/caches/SQLiteCache.php index 94f6e289..becedde4 100644 --- a/caches/SQLiteCache.php +++ b/caches/SQLiteCache.php @@ -37,10 +37,14 @@ class SQLiteCache implements CacheInterface $this->db = new \SQLite3($config['file']); $this->db->enableExceptions(true); $this->db->exec("CREATE TABLE storage ('key' BLOB PRIMARY KEY, 'value' BLOB, 'updated' INTEGER)"); + // Consider uncommenting this to add an index on expiration + //$this->db->exec('CREATE INDEX idx_storage_updated ON storage (updated)'); } $this->db->busyTimeout($config['timeout']); + // https://www.sqlite.org/pragma.html#pragma_journal_mode $this->db->exec('PRAGMA journal_mode = wal'); + // https://www.sqlite.org/pragma.html#pragma_synchronous $this->db->exec('PRAGMA synchronous = NORMAL'); } |