File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,13 @@ http {
37
37
set_by_lua_block $npm_config_registry {
38
38
return ngx.shared.npmConfig:get('npm_config_registry' )
39
39
}
40
+ set $ephemeralCacheStatus '-' ;
40
41
location ~ ^/(.+)/-/(.+\.tgz)$ {
41
42
root /tmp/npm/store;
43
+ set $ephemeralCacheStatus "HIT" ;
42
44
try_files /$1 /$2 @fetch-tgz;
43
45
}
44
46
location / {
45
- set $ephemeralCacheStatus '-' ;
46
47
# We can't do caching at the proxy level because we can't easily
47
48
# parameterize cache lifetime for proxy_cache. Instead, we do
48
49
# the caching ourselves in Lua using a shared dict.
66
67
}
67
68
location @fetch-tgz {
68
69
internal ;
70
+ set $ephemeralCacheStatus "MISS" ;
69
71
resolver 127.0.0.1 ipv6=off;
70
72
proxy_pass $npm_config_registry ;
71
73
proxy_buffering on ;
You can’t perform that action at this time.
0 commit comments