You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/01 03:00:25 UTC

[GitHub] [apisix] cocozhaocs opened a new issue #6474: request help: Some questions about proxy cache plugin, disk cache, cache_ttl and logs

cocozhaocs opened a new issue #6474:
URL: https://github.com/apache/apisix/issues/6474


   ### Issue description
   
   1. when I used disk cache strategy,  I changed the cache_ttl value  in config.yaml and in plugin parameters by using curl,but the cache seems still keep valid for 10s。so I tried to find how cache cache_ttl works in your code(apisix/plugins/proxy-cache), but I did not figuere out where the cache_ttl works in diskhandler.lua and util.lua 。
   
   2. In diskhandler.lua and util.lua , I found that there are some founctions to generate cache file name and purge the cache file ,but how to save the cache file?  How it works to save the cache file in APISIX?
   
   3. I would like to firgure out how the cache plugin works,I setted the log_level and error_log_level value of "debug",but I did not find log (eg: core.log.info("proxy-cache complex value: ", core.json.delay_encode(data)))in access.log and error.log。What should I do to see the log like what has been mentioned?
   
   ### Environment
   
   -apisix version  2.11.0
   -OS centos 9
   -Nginx version 1.19.0
   -etcd version 3.4.15


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #6474: request help: Some questions about proxy cache plugin, disk cache, cache_ttl and logs

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6474:
URL: https://github.com/apache/apisix/issues/6474#issuecomment-1055337847


   > it seems that memory_handler.lua never be called.
   
   it's base on `cache_strategy`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #6474: request help: Some questions about proxy cache plugin, disk cache, cache_ttl and logs

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6474:
URL: https://github.com/apache/apisix/issues/6474#issuecomment-1055014423


   > 1. when I used disk cache strategy,  I changed the cache_ttl value  in config.yaml and in plugin parameters by using curl,but the cache seems still keep valid for 10s。so I tried to find how cache cache_ttl works in your code(apisix/plugins/proxy-cache), but I did not figuere out where the cache_ttl works in diskhandler.lua and util.lua 。
   
   This is where cache_ttl works: https://github.com/apache/apisix/blob/bba6a0012b317bff656bdb614ae5e33150fc1920/apisix/plugins/proxy-cache/memory_handler.lua#L289
   
   `conf.cache_ttl` will only be used if `conf.cache_control` is false or `parse_resource_ttl(ctx, cc)` is false.
   
   If you verify out that this is not the case, please provide the full reproduction steps.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] cocozhaocs commented on issue #6474: request help: Some questions about proxy cache plugin, disk cache, cache_ttl and logs

Posted by GitBox <gi...@apache.org>.
cocozhaocs commented on issue #6474:
URL: https://github.com/apache/apisix/issues/6474#issuecomment-1055076476


   > 
   
   
   
   > 
   
   
   
   > 1. thanks your reply. It seems that only use ’memory cache strategy‘ can cache_ttl work. Disk_handler.lua and util.lua never 
   call memory_handler.lua to make cache_tll valid or directly  use cache_ttl in conf. If I am wrong,where does 'disk cache strategy‘ use cache_ttl?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #6474: request help: Some questions about proxy cache plugin, disk cache, cache_ttl and logs

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6474:
URL: https://github.com/apache/apisix/issues/6474#issuecomment-1055018251


   > 3\. I would like to firgure out how the cache plugin works,I setted the log_level and error_log_level value of "debug",but I did not find log (eg: core.log.info("proxy-cache complex value: ", core.json.delay_encode(data)))in access.log and error.log。What should I do to see the log like what has been mentioned?
   
   Can you determine if the code is running where you are printing the logs?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #6474: request help: Some questions about proxy cache plugin, disk cache, cache_ttl and logs

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6474:
URL: https://github.com/apache/apisix/issues/6474#issuecomment-1055017770


   > 2\. In diskhandler.lua and util.lua , I found that there are some founctions to generate cache file name and purge the cache file ,but how to save the cache file?  How it works to save the cache file in APISIX?
   
   Now there is no such feature. And I'm staying cautious about this feature. Cache files generated during the APISIX run should be deleted by APISIX. This is the life cycle of the cache file. I'm worried that keeping the cache file will cause the file to keep accumulating.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] cocozhaocs commented on issue #6474: request help: Some questions about proxy cache plugin, disk cache, cache_ttl and logs

Posted by GitBox <gi...@apache.org>.
cocozhaocs commented on issue #6474:
URL: https://github.com/apache/apisix/issues/6474#issuecomment-1055080822


   > 
   I use 'disk cache strategy' ranther than 'momory cache strategy' and it seems that memory_handler.lua never be called.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org