Skip to content

Commit

Permalink
feat: add cache settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cifko committed Feb 26, 2024
1 parent 1107259 commit 72fbd37
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions routes/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function fromHexString(hexString) {
}

router.get("/:height_or_hash", async function (req, res) {
res.setHeader("Cache-Control", "public, max-age=120, immutable");
try {
let client = createClient();
let height_or_hash = req.params.height_or_hash;
Expand Down
1 change: 1 addition & 0 deletions routes/mempool.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ var router = express.Router();

/* GET mempool page. */
router.get("/:excessSigs", async function (req, res) {
res.setHeader("Cache-Control", "public, max-age=0, must-revalidate");
try {
let client = createClient();
let txId = req.params.excessSigs.split("+");
Expand Down
1 change: 1 addition & 0 deletions routes/search_commitments.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var express = require("express");
var router = express.Router();

router.get("/", async function (req, res) {
res.setHeader("Cache-Control", "public, max-age=120, immutable");
let client = createClient();
let commitments = (
req.query.comm ||
Expand Down
1 change: 1 addition & 0 deletions routes/search_kernels.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var express = require("express");
var router = express.Router();

router.get("/", async function (req, res) {
res.setHeader("Cache-Control", "public, max-age=120, immutable");
let client = createClient();
let nonces = (req.query.nonces || "").split(",");
let signatures = (req.query.signatures || "").split(",");
Expand Down

0 comments on commit 72fbd37

Please sign in to comment.