Skip to content

Use sqlite database as storage for http cache #24

Description

@mscottford

The ktor library has support for caching HTTP requests, but that cache is in-memory only. We want to be able to cache requests across different calls to the executable, so we need to use a persistent store for that. The ktor caching support is exposed via a simple interface that we can implement.

The ktorm project can be used for connecting the cache database.

In addition to the path to the sqlite database to work with, callers will also need to provide the name of the table to use for storage.

  • HTTP requests will be written to the specified table
  • The lifetime of the cache entries will be honored by the cache (lifetimes will be checked on cache read against the age of the entry, and the entry will be deleted if it has expired).
  • If the path to the database file does not exist it will be created
  • If the database does not exist then it will be created
  • If the specified table does not exist in the database it will be created with the correct columns
  • It will be possible to write to the cache from separate processes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions