-
Notifications
You must be signed in to change notification settings - Fork 39
Add a persistent image cache #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
851f7ba to
ce16fea
Compare
|
Just some random tidbits:
|
d70ec18 to
002581f
Compare
Guess who has two thumbs and gets to port things away from |
5b16ba3 to
1dbcd30
Compare
|
Still a little ways to go, but getting closer at least 🎉 |
2fb468d to
70b4810
Compare
55ec404 to
73f5533
Compare
6fb7c8e to
8b2ebb9
Compare
rebase this test(image_cache): Add tests for image cache headers rebase this f Migrate over to `http-cache-semantics` f refactor(tests): Drop wiremock (Inlyne-Project#320) * docs: Describe what we use deps for * refactor(tests): Switch `wiremock` for a custom impl refactor(tests): simplify the file server (Inlyne-Project#321) Refactor local image caching Hashing out more of the impl needs _soooo_ much refactoring Dirty rebase artifacts. Fix later rebase me away slowly getting the final pieces together time to update with `main` Nail down most of the routing Dont pre-render SVGs before storage Get more of the custom test env setup Get the sanity test working refactor(cache): Switch db from redb to sqlite Use our shiny new test utils refactor: Delete dead test code rebase into commit that added it rename images.data -> images.image remove redb dep lalalalala f get local image fetching working Get more tests sorted out Shrank test data image rebase original file out of git history Test suite is getting better getting closer Add etag flow to test server test: Add support for dynamic image test servers rebase this: lru test mostly working rebase this some cleanup more image cache tests
8b2ebb9 to
c804431
Compare
39a5faf to
2bd3532
Compare
|
The test suite is a good representation of the current state of the PR $ cargo t image::cache
...
running 17 tests
test image::cache::tests::global_ttl ... ignored, TODO: waiting for garbage collection
test image::cache::tests::lru ... ignored, TODO: waiting for garbage collection
test image::cache::tests::mutli_client_mash ... ignored, TODO: waiting for garbage collection
test image::cache::tests::remote_404_error ... ok
test image::cache::tests::private_cache ... ok
test image::cache::tests::etag_refresh_same ... ok
test image::cache::tests::selectively_stores ... ok
test image::cache::tests::remote_layers ... ok
test image::cache::tests::corrupt_db_entry ... ok
test image::cache::tests::etag_refresh_different ... ok
test image::cache::tests::local_invalidation ... ok
test image::cache::tests::invalid_img ... ok
test image::cache::tests::stats ... ok
test image::cache::tests::local_svg_layers ... ok
test image::cache::tests::local_layers ... ok
test image::cache::tests::past_max_age_refetch ... ok
test image::cache::tests::remote_svg_layers ... ok
test result: ok. 14 passed; 0 failed; 3 ignored; 0 measured; 54 filtered out; finished in 0.27sThe only thing left to implement is garbage collection (including probably updating entry's m-times) and wiring up the cache to actually be used by the application Potential future work
|
|
I think reasonably we could leave the persistent cache disabled by default behind a dev toggle, kick the can on GC stuff and any of the nitty gritty thread pool stuff that we could do, and merge this after replacing the current in-memory cache with the one in this PR |
This will eventually resolve #234