Skip to content

Commit

Permalink
Merge pull request #2 from zylcom/product-controller
Browse files Browse the repository at this point in the history
feat(product-controller): update max-age value in cache control header
  • Loading branch information
zylcom authored Jul 29, 2023
2 parents 29721d2 + 417b126 commit 2d660ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controllers/product-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const get = async (req, res, next) => {
const slug = req.params.slug;
const result = await productService.get(slug);

res.status(200).set("Cache-Control", "public, max-age=120000").json({ data: result });
res.status(200).set("Cache-Control", "public, max-age=31536000").json({ data: result });
} catch (error) {
next(error);
}
Expand Down Expand Up @@ -39,7 +39,7 @@ const infinite = async (req, res, next) => {
};
const result = await productService.infinite(request);

res.status(200).json({ data: result.data, paging: result.paging });
res.status(200).set("Cache-Control", "public, max-age=31536000").json({ data: result.data, paging: result.paging });
} catch (error) {
next(error);
}
Expand Down

0 comments on commit 2d660ac

Please sign in to comment.