Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
也许有些人为的例子,但对于这样的顶级任务:
cache_duration_seconds := 60 * 60 * 24 * 30
OPA 是否将该值识别为常量并在请求之间保留它,还是将在每次调用时计算它?
OPA 将记住规则生成的值并在策略查询期间将其缓存。换句话说,在这种情况下,如果cache_duration_seconds在策略中被多次引用,它将被计算一次,然后在每个位置重新使用。下次查询策略时,将再次计算该值。
cache_duration_seconds