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

Warm cache without returning data to requestor? #10

Open
kyledrake opened this issue Aug 8, 2014 · 1 comment
Open

Warm cache without returning data to requestor? #10

kyledrake opened this issue Aug 8, 2014 · 1 comment

Comments

@kyledrake
Copy link

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?

@runningman84
Copy link

what about calling using the head method? For example curl -I http://localhost/... might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants