Warm cache without returning data to requestor?
kyledrake opened this issue · 1 comments
kyledrake commented
I'm using this code to this to warm the cache:
location /:cache/warm {
rewrite ^/:cache/warm(/.*)$ $1;
root /home/web;
slowfs_cache sites;
slowfs_cache_key $1;
slowfs_cache_valid 15d;
break;
}
Which works great, but it also returns the entire file. If I want to warm up a lot of large files, this will go much slower.
I tried adding return 200 "ok";
to the location block:
location /:cache/warm {
rewrite ^/:cache/warm(/.*)$ $1;
root /home/web;
slowfs_cache sites;
slowfs_cache_key $1;
slowfs_cache_valid 15d;
return 200 "ok";
break;
}
But when I do this, the file doesn't get cached.
Is there a sneaky way to cache the file without serving it?
kyledrake commented
Sincere apologies, this is the wrong project!