Replies: 3 comments
-
Hello, @kvnhrtwg, Appreciate the interest 😄 This is an interesting idea, it should be possible but i believe adding more keys per event obj would be more useful than changing the trigger value type as this is something specific to the event trigger type. Something along the lines of a url and params keys, ending up with something like this module.exports = ({ env }) => ({
"website-builder": {
enabled: true,
config: {
url: "http://localhost:3000/api/revalidate",
trigger: {
type: "event",
events: [
{
params: { //add page=recipes as params to config.url
page: "recipes",
},
model: "recipes",
types: ["create", "delete"],
},
{
params: { //add page=home as params to config.url
page: "home",
},
model: "home",
types: ["create", "update", "delete"],
},
{
url: "http://localhost:6000/api", // this special model needs to hit another api when changed
params: {
page: "home",
},
model: "special",
types: ["create", "update", "delete"],
},
],
},
},
},
}); The params would be added to any existing url params defined in top level url. The url would by default be the top level url with the event specfic URL used if defined. In doing so it should cover most use cases. What do you think? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick feedback! |
Beta Was this translation helpful? Give feedback.
-
Support for it has been added in #13, it will be available in the next release. |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks for the great plugin!
I was wondering, if you're planning to add the functionality to define multiple triggers for different models.
This would be awesome for example for Next.js On-demand Incremental Static Regeneration.
Then one could define triggers for all pages that are connected to a specific Strapi model, and only this specific page would get regenerated and not the whole app would be rebuild.
For example:
Beta Was this translation helpful? Give feedback.
All reactions