Skip to content

Commit

Permalink
Gateway caching (#390)
Browse files Browse the repository at this point in the history
* Added response caching
* Added HTTP caching
* Commented out caching plugins for now
  • Loading branch information
smakhtin committed Feb 23, 2023
1 parent 6261028 commit e3e18f3
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 155 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"nuxtjs",
"oraclisation",
"oraclise",
"outdir",
"Polkadot",
"QGIS",
"Smakhtin",
Expand Down
1 change: 0 additions & 1 deletion apps/docs/.nvmrc

This file was deleted.

7 changes: 7 additions & 0 deletions apps/gateway/.meshrc.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ additionalResolvers:
}
sourceArgs:
cid: '{root.tokenURI}'
plugins:
# - responseCache:
# includeExtensionMetadata: true
- httpCache:
# cache:
# cfwKv:
# namespace: MESH
7 changes: 5 additions & 2 deletions apps/gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
"codegen": "mustache config/production.js .meshrc.template.yaml > .meshrc.yaml",
"codegen:staging": "env-cmd mustache config/staging.js .meshrc.template.yaml > .meshrc.yaml",
"start": "mesh start",
"dev": "wrangler dev",
"dev": "yarn codegen:staging && wrangler dev",
"deploy": "yarn codegen && wrangler publish",
"deploy:staging": "yarn codegen:staging && wrangler publish --env staging",
"build": "yarn codegen && wrangler publish --dry-run --outdir=dist"
},
"dependencies": {
"@graphql-mesh/cache-cfw-kv": "0.1.13",
"@graphql-mesh/cli": "0.82.23",
"@graphql-mesh/graphql": "0.34.6",
"@graphql-mesh/json-schema": "0.37.15",
"@graphql-mesh/plugin-http-cache": "0.1.14",
"@graphql-mesh/plugin-response-cache": "0.2.15",
"@graphql-mesh/transform-resolvers-composition": "0.13.13",
"graphql": "16.6.0"
},
Expand All @@ -23,6 +26,6 @@
"env-cmd": "^10.1.0",
"eslint-config-sni": "*",
"mustache": "4.2.0",
"wrangler": "2.10.0"
"wrangler": "2.11.0"
}
}
8 changes: 8 additions & 0 deletions apps/gateway/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ compatibility_date = "2023-02-15"
main = "src/index.ts"
node_compat = true

kv_namespaces = [
{ binding = "MESH", id = "484c8484d2ad47f88fa144ab8fe4a3b4", preview_id = "0f39b84051b24cb8bb065a737fcab0b3" }
]

[env.staging]
name="graphql-gateway-staging"
kv_namespaces = [
{ binding = "MESH", id = "74d34612837d477694f9aba03d82a336" }
]


[build]
command = "mesh build"
Loading

1 comment on commit e3e18f3

@vercel
Copy link

@vercel vercel bot commented on e3e18f3 Feb 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

identifier-docs – ./apps/docs

identifier-docs-git-main-sovereign-nature.vercel.app
sni-docs.vercel.app
identifier-docs-sovereign-nature.vercel.app

Please sign in to comment.