Skip to content

Commit

Permalink
feat: add cache
Browse files Browse the repository at this point in the history
  • Loading branch information
tefkah committed May 16, 2023
1 parent 70cf054 commit da0df94
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
49 changes: 27 additions & 22 deletions apps/strapi/config/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,33 @@ export default ({ env }: { env: Env }) => ({
},
},
},
// "rest-cache": {
// config: {
// provider: {
// name: "memory",
// options: {
// max: 32767,
// maxAge: 3600,
// },
// },
// strategy: {
// contentTypes: [
// // list of Content-Types UID to cache
// "api::category.category",
// "api::content-content-interface.content-content-interface",
// "api::content-update-interface.content-update-interface",
// "api::article.article",
// "api::global.global",
// "api::homepage.homepage",
// ],
// },
// },
// },
'rest-cache': {
config: {
provider: {
name: 'memory',
options: {
max: 32767,
maxAge: 3600,
},
},
strategy: {
contentTypes: [
// list of Content-Types UID to cache
'api::category.category',
'api::jote-article.jote-article',
'api::page.page',
'api::blog-post.blog-post',
'api::tag.tag',
'api::blog-author.blog-author',
'api::team-member.team-member',
'plugin::menus.menu',
],
hitpass: (ctx: any) => {
return Boolean(ctx.request.headers.cookie)
},
},
},
},
comments: {
enabled: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2023-05-16T13:10:15.926Z"
"x-generation-date": "2023-05-16T19:02:38.064Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down

0 comments on commit da0df94

Please sign in to comment.