-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cache wont automatically purge after content type updated #11
Comments
Hello @yulafezmesi |
Here is the output: {
debug: false,
enableEtag: false,
enableXCacheHeaders: false,
enableAdminCTBMiddleware: true,
resetOnStartup: false,
clearRelatedCache: true,
maxAge: 3600000,
keysPrefix: '',
contentTypes: [
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::activity.activity',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::location.location',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::offer.offer',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::package.package',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::extra.extra',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::activity-provider.activity-provider',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::review.review',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::image.image',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::district.district',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::city.city',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::postal-code.postal-code',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::image-category.image-category',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::image-type.image-type',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: [Function: hitpass],
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::corona-opening-model.corona-opening-model',
relatedContentTypeUid: [Array]
}
],
keys: CacheKeysConfig { useHeaders: [], useQueryParams: true }
} |
It should also show you something like this on startup:
and when you update an entity on the admin, you should see which keys are purged:
Also, can you share your plugin config form |
I am having the same issue: Here is the debug startup {
debug: false,
enableEtag: false,
enableXCacheHeaders: true,
enableAdminCTBMiddleware: true,
resetOnStartup: false,
clearRelatedCache: true,
maxAge: 3600000,
keysPrefix: '',
contentTypes: [
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::course.course',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::lesson.lesson',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::order.order',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::product.product',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::lead.lead',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::agent.agent',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::contact.contact',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::opportunity.opportunity',
relatedContentTypeUid: [Array]
},
CacheContentTypeConfig {
singleType: false,
injectDefaultRoutes: true,
maxAge: 3600000,
hitpass: false,
keys: [CacheKeysConfig],
plugin: undefined,
routes: [Array],
contentType: 'api::account.account',
relatedContentTypeUid: [Array]
}
],
keys: CacheKeysConfig { useHeaders: [], useQueryParams: true }
} Here is my response when I update the admin
Here is my config module.exports = ({ env }) => ({
redis: {
config: {
connections: {
default: {
connection: {
host: config.host,
port: config.port,
user: config.user,
db: 0,
password: config.password,
},
settings: {
debug: true,
cluster: false,
},
}
}
}
},
"rest-cache": {
config: {
provider: {
name: "redis",
options: {
max: 1000,
connection: "default",
},
},
strategy: {
enableXCacheHeaders: true,
hitpass: false,
clearRelatedCache: true,
contentTypes: [
"api::course.course",
"api::lesson.lesson",
"api::product.product",
"api::lead.lead",
"api::agent.agent",
"api::contact.contact",
"api::opportunity.opportunity",
"api::account.account"
]
}
}
},
}); Hope this helps. I might have setup something wrong as well. |
Hi, many thanks for this package. It might be a bug or just a quick question.
The cache data won't purge unless click
Purge Rest Cache
button on the list. Should it be done with a built-in config? Do we need an additional config to do that?Cache type: Memory
Rest cache version: 4.1.0
Strapi version: 4.1.3
Node: v14.18.2
The text was updated successfully, but these errors were encountered: