memoize

package
v3.0.0-...-a62b8d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

README

Memoize

Memoize allows to cache certain expensive function calls and cache the result. The main advantage in Coraza is to memoize the regexes and aho-corasick dictionaries when the connects spins up more than one WAF in the same process and hence same regexes are being compiled over and over.

Currently it is opt-in under the memoize_builders build tag as under a misuse (e.g. using after build time) it could lead to a memory leak as currently the cache is global.

Important: Connectors with live reload functionality (e.g. Caddy) could lead to memory leaks which might or might not be negligible in most of the cases as usually config changes in a WAF are about a few rules, this is old objects will be still alive in memory until the program stops.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(_ string, fn func() (interface{}, error)) (interface{}, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL