Merge pull request 'fix: Add cache headers to Ponder GraphQL proxy in Caddy (#447)' (#477) from fix/issue-447 into master
This commit is contained in:
commit
becfb98198
2 changed files with 7 additions and 11 deletions
|
|
@ -3,6 +3,7 @@
|
|||
reverse_proxy webapp:5173
|
||||
}
|
||||
route /api/graphql* {
|
||||
header Cache-Control "public, max-age=5"
|
||||
uri strip_prefix /api
|
||||
reverse_proxy ponder:42069
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,15 +364,7 @@ async function fetchStats() {
|
|||
try {
|
||||
const controller = new AbortController();
|
||||
const timeout = setTimeout(() => controller.abort(), 10000);
|
||||
const endpoint = `${window.location.origin}/api/graphql`;
|
||||
const response = await fetch(endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
signal: controller.signal,
|
||||
body: JSON.stringify({
|
||||
query: `
|
||||
const query = `
|
||||
query ProtocolStats {
|
||||
statss(where: { id: "0x01" }) {
|
||||
items {
|
||||
|
|
@ -390,8 +382,11 @@ async function fetchStats() {
|
|||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
}),
|
||||
`;
|
||||
const endpoint = `${window.location.origin}/api/graphql?query=${encodeURIComponent(query)}`;
|
||||
const response = await fetch(endpoint, {
|
||||
method: 'GET',
|
||||
signal: controller.signal,
|
||||
});
|
||||
|
||||
clearTimeout(timeout);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue