Skip to content
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

downloaded again after the service restarts #38

Open
wusertu opened this issue Mar 9, 2021 · 4 comments
Open

downloaded again after the service restarts #38

wusertu opened this issue Mar 9, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@wusertu
Copy link

wusertu commented Mar 9, 2021

I have a problem with the same file being downloaded again after the service restarts

@sillygod
Copy link
Owner

@wusertu hi,

Well, I am sorry I don't understand what you mean. Could you please elaborate on it with an example? That will help me to understand what you've encountered.

@love4taylor
Copy link

@sillygod Like this, request the file once to get the cache, then restart the caddy service and request the file again, then the same file is downloaded repeatedly

love4taylor@EGOIST:/data/caddy/cache/pximg$ ll -h
total 2.7M
drwxr-xr-x 2 root root  32K Jul 19 23:28 ./
drwxr-xr-x 3 root root 4.0K Jul 19 13:37 ../
-rw------- 1 root root 1.3M Jul 19 23:28 caddy-cache-855862080
-rw------- 1 root root 1.3M Jul 19 23:28 caddy-cache-966089272
love4taylor@EGOIST:/data/caddy/cache/pximg$ sudo sha256sum caddy-cache-*
b76b8760c4db809ed87b647eead9c8ad58a4daebd0e1e14c00412f9730dae689  caddy-cache-855862080
b76b8760c4db809ed87b647eead9c8ad58a4daebd0e1e14c00412f9730dae689  caddy-cache-966089272
love4taylor@EGOIST:/data/caddy/cache/pximg$

@sillygod
Copy link
Owner

oh, ok. This situation will happen when the cache type is set to file. I will fix this in my spare time. If you hurry, you may try to use an in-memory cache instead. here is the example settings.

@sillygod sillygod added the bug Something isn't working label Jul 20, 2021
@teodorescuserban
Copy link

+1 to this issue.

The file system cache type is not managed after a caddy restart. The files remain on the filesystem, but are not taken into account by the cache - for example going to admin api curl -X GET localhost:2019/caches/ will return an empty response.

I see that the files themselves do not contain any information about the cache_key like nginx does.

I do commend you for:

  • list and purge api
  • custom cache key

I hope you do have a bit of time to fix this, it already looks really nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants