0

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

kong.cache.invalidate_local("thisisastring")

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.

https://github.com/Kong/kong/blob/2.7.0/kong/cache/init.lua#L226

What is wrong?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Peter Claes
  • 285
  • 3
  • 9

1 Answers1

1

You should use : not .

      kong.cache:invalidate_local("your string")

More info about difference between : and .

Ôrel
  • 7,044
  • 3
  • 27
  • 46