Skip to content

Why still get into srcache_store handler even if $srcache_expire=0? #45

@wonderbeyond

Description

@wonderbeyond

I just put my srcache settings directly under server block:

server {
    set $canonical_host www.example.com;

    # ...

    srcache_default_expire 0;
    set_escape_uri $pagecache_key $canonical_host$uri$is_args$args;
    srcache_fetch GET /pagecache key=$pagecache_key;
    srcache_store PUT /pagecache key=$pagecache_key&exptime=$srcache_expire;
    include srcache_status_headers;

    # ...
}

You see, I use srcache_default_expire, So the $srcache_expire will default to 0,
I expect my upstream setting their appropriate exptime by max-age.

However, my srcache_store get involved even if $srcache_expire==0,
and then cause an extra useless redis request.

location = /redis_put {
    # tested OK with SSDB
    internal;
    set_unescape_uri $exptime $arg_exptime;

    redis2_query setx $redis_key $echo_request_body $exptime;

    redis2_pass pagecache_ssdb;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions