{"action":"opened","issue":{"url":"https://api.github.com/repos/openresty/srcache-nginx-module/issues/61","repository_url":"https://api.github.com/repos/openresty/srcache-nginx-module","labels_url":"https://api.github.com/repos/openresty/srcache-nginx-module/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/openresty/srcache-nginx-module/issues/61/comments","events_url":"https://api.github.com/repos/openresty/srcache-nginx-module/issues/61/events","html_url":"https://github.com/openresty/srcache-nginx-module/issues/61","id":188278052,"number":61,"title":"$srcache_expire is always empty","user":{"login":"onnimonni","id":5691777,"avatar_url":"https://avatars.githubusercontent.com/u/5691777?v=3","gravatar_id":"","url":"https://api.github.com/users/onnimonni","html_url":"https://github.com/onnimonni","followers_url":"https://api.github.com/users/onnimonni/followers","following_url":"https://api.github.com/users/onnimonni/following{/other_user}","gists_url":"https://api.github.com/users/onnimonni/gists{/gist_id}","starred_url":"https://api.github.com/users/onnimonni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onnimonni/subscriptions","organizations_url":"https://api.github.com/users/onnimonni/orgs","repos_url":"https://api.github.com/users/onnimonni/repos","events_url":"https://api.github.com/users/onnimonni/events{/privacy}","received_events_url":"https://api.github.com/users/onnimonni/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-09T15:41:28Z","updated_at":"2016-11-09T15:41:28Z","closed_at":null,"body":"Hey!\r\n\r\nI have been trying srcache with redis for few weeks now and today I noticed that the cache keys are not expiring automatically.\r\n\r\nI'm using this config in local docker environment:\r\n```\r\n##\r\n# Adds internal locations for storing and getting full page cache from redis\r\n##\r\n\r\nsrcache_default_expire 10s;\r\nsrcache_max_expire 10s;\r\n\r\nlocation /redis-fetch {\r\n    internal;\r\n\r\n    ##\r\n    # In order to use password authentication we use custom redis module which adds $redis_auth:\r\n    # - https://github.com/Yongke/ngx_http_redis-0.3.7\r\n    ##\r\n\r\n    # Read the configuration from system envs\r\n    set $redis_auth '';\r\n    set $redis_db 0;\r\n\r\n    set $redis_key $args;\r\n\r\n    redis_pass 172.17.0.6:6379;\r\n}\r\n\r\nlocation /redis-store {\r\n    internal;\r\n\r\n    set_unescape_uri $exptime $arg_exptime;\r\n    set_unescape_uri $key $arg_key;\r\n\r\n    # redis module pipelines these 3 commands into single request\r\n    redis2_query auth '';\r\n    redis2_query select 0;\r\n    redis2_query set $key $echo_request_body;\r\n    redis2_query expire $key $srcache_expire;\r\n\r\n    # Pass the request to redis\r\n    redis2_pass 172.17.0.6:6379;\r\n\r\n}\r\n```\r\n\r\nThen I open redis-cli to monitor incoming requests:\r\n```\r\n$ redis-cli\r\n> monitor\r\n1478704802.63890 [0 172.17.0.8:54906] \"select\" \"0\"\r\n1478704802.638100 [0 172.17.0.8:54906] \"get\" \"wp_:nginx:httpsGETwordpress.test/robots.txt\"\r\n1478704802.638122 [0 172.17.0.8:54900] \"auth\" \"\"\r\n1478704802.638137 [0 172.17.0.8:54900] \"select\" \"0\"\r\n1478704802.638148 [0 172.17.0.8:54900] \"set\" \"wp_:nginx:httpsGETwordpress.test/robots.txt\" \"HTTP/1.1 200 OK\\r\\nContent-Type: text/plain; charset=utf-8\\r\\nExpires: Thu, 19 Nov 1981 08:52:00 GMT\\r\\nCache-Control: no-store, no-cache, must-revalidate\\r\\nPragma: no-cache\\r\\nX-Robots-Tag: noindex, follow\\r\\nLink: <https://wordpress.test/wp-json/>; rel=\\\"https://api.w.org/\\\"\\r\\nLink: <https://wordpress.test/wp-json>; rel=\\\"https://github.com/WP-API/WP-API\\\"\\r\\nX-Cache: MISS\\r\\n\\r\\nUser-agent: *\\nDisallow: /wp-admin/\\nAllow: /wp-admin/admin-ajax.php\\n\"\r\n1478704802.638189 [0 172.17.0.8:54900] \"expire\" \"wp_:nginx:httpsGETwordpress.test/robots.txt\" \"\"\r\n```\r\n\r\nAnd where I should see `10s` because of the `srcache_max_expire` directive  or `0` because of the `Cache-Control: no-store, no-cache, must-revalidate` header instead  I see `\"\"` as sent to redis.\r\n\r\n**Version:**\r\n```\r\nnginx -V\r\nnginx version: openresty/1.11.2.1\r\nbuilt by gcc 4.9.2 (Debian 4.9.2-10)\r\nbuilt with OpenSSL 1.0.2j  26 Sep 2016\r\nTLS SNI support enabled\r\nconfigure arguments: --prefix=/etc/nginx/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.60 --add-module=../xss-nginx-module-0.05 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.31 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.06 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.6 --add-module=../ngx_lua_upstream-0.06 --add-module=../headers-more-nginx-module-0.31 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.17 --add-module=../redis2-nginx-module-0.13 --add-module=../rds-json-nginx-module-0.14 --add-module=../rds-csv-nginx-module-0.07 --with-ld-opt=-Wl,-rpath,/etc/nginx/luajit/lib --with-http_addition_module --with-http_auth_request_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-http_geoip_module=dynamic --with-file-aio --with-ipv6 --with-pcre-jit --with-stream --with-stream_ssl_module --with-threads --without-http_autoindex_module --without-http_browser_module --without-http_userid_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_split_clients_module --without-http_uwsgi_module --without-http_scgi_module --without-http_referer_module --user=nginx --group=nginx --sbin-path=/usr/sbin --modules-path=/usr/lib/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx/nginx.lock --http-fastcgi-temp-path=/tmp/nginx/fastcgi --http-proxy-temp-path=/tmp/nginx/proxy --http-client-body-temp-path=/tmp/nginx/client_body --add-module=/tmp/ngx_http_redis-0.3.7-master --add-module=/tmp/ngx_pagespeed-1.11.33.4-beta --with-openssl=/tmp/openssl-1.0.2j\r\n```"}}
{"actor":{"display_login":"onnimonni"}}