Skip to content
Playground(another site)

bynk.http.cache_unknown_arg

Error A @cache annotation has an argument outside the closed set (maxAge/scope/immutable).

@cache takes three named arguments: maxAge, scope and immutable. The set is closed, so a misspelt or invented option is refused rather than ignored, which would leave the route with caching you did not ask for. A positional argument is refused too. Rename the argument or remove it. The values are checked by bynk.http.cache_bad_max_age, bynk.http.cache_bad_scope and bynk.http.cache_bad_immutable.

Example

@cache(maxAge: 5.minutes, stale: true) // ✗ not an argument of `@cache`
on GET("/links") () -> Effect[HttpResult[String]] by v: Visitor { … }
@cache(maxAge: 5.minutes) // ✓
on GET("/links") () -> Effect[HttpResult[String]] by v: Visitor { … }

In the Book

See also

  • Every code in its category, HTTP, on the diagnostic index.
  • bynk explain bynk.http.cache_unknown_arg shows the same from the installed toolchain, without a network.