Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kevinmichaelchen/go-hasura-authentication-webhook

Simple Hasura webhook auth server with time.Sleep to test HTTP caching
https://github.com/kevinmichaelchen/go-hasura-authentication-webhook

Last synced: about 2 months ago
JSON representation

Simple Hasura webhook auth server with time.Sleep to test HTTP caching

Awesome Lists containing this project

README

        

## Caching HTTP responses

The [`Cache-Control`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control)
HTTP header field holds directives (instructions) — in both requests and
responses — that control caching in browsers and shared caches (e.g. Proxies,
CDNs).

If we send back the header
```
Cache-Control: max-age=604800
```
we're instructing the HTTP client to cache for 604800 seconds (7 days).

## Does Hasura cache responses for webhook authentication?

In Hasura, you can defer auth decisions to an external endpoint (i.e., a
webhook).

https://hasura.io/docs/latest/auth/authentication/webhook/