Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advertise cache retention duration for cloudflare #330

Open
poszu opened this issue Aug 1, 2023 · 0 comments
Open

Advertise cache retention duration for cloudflare #330

poszu opened this issue Aug 1, 2023 · 0 comments
Assignees

Comments

@poszu
Copy link
Contributor

poszu commented Aug 1, 2023

motivation

We use Cloudflare in front of poets to cache some endpoints like /info, /proofs, /pow_params etc. Currently, cache retention is configured on the CF side, but it would be best if the poet notified CF for how long it can cache responses. This is possible in HTTP with the Cache-Control HTTP header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control.

It is possible to inject HTTP headers in responses in a GRPC-gateway (GRPC-HTTP proxy that we use) with https://grpc-ecosystem.github.io/grpc-gateway/docs/mapping/customizing_your_gateway/#mutate-response-messages-or-set-response-headers

endpoints

/info

It contains dynamic content (open and executing round IDs) that changes every round (epoch). It could advertise max-age till the end of round

/pow_params

It serves 2 values:

  • challenge - it currently changes after a round is finished (it's the root of the last proof),
  • difficulty - set in configuration, it can change after poet service was restarted.

/proofs

The content is static and never changes - can be cached indefinitely.

/submit

Should never be cached.

@poszu poszu self-assigned this Aug 1, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Dev team kanban Aug 1, 2023
@poszu poszu moved this from 📋 Backlog to 🔖 Next in Dev team kanban Sep 8, 2023
@poszu poszu moved this from 🔖 Next to 🏗 Doing in Dev team kanban Sep 8, 2023
@poszu poszu moved this from 🏗 Doing to 🔖 Next in Dev team kanban Sep 13, 2023
@poszu poszu moved this from 🔖 Next to 📋 Backlog in Dev team kanban Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant