kong cache invalidation throws error : key must be a string

In a custom plugin I need to invalidate a Kong cache entry. When I use


I get error

key must be a string
 stack traceback:
    [C]: in function 'error'
    /usr/local/share/lua/5.1/kong/cache/init.lua:226: in function 'invalidate_local'

I'm using Kong 2.7.0.

What is wrong?


  • You should use : not .

          kong.cache:invalidate_local("your string")

    More info about difference between : and .