expireTime
You can specify a customstale-while-revalidate
expire time for CDNs to consume in theCache-Control
header for ISR enabled pages.
Opennext.config.js
and add theexpireTime
config:
module.exports= {// one hour in seconds expireTime:3600,}
Now when sending theCache-Control
header the expire time will be calculated depending on the specific revalidate period.
For example, if you have a revalidate of 15 minutes on a path and the expire time is one hour the generatedCache-Control
header will bes-maxage=900, stale-while-revalidate=2700
so that it can stay stale for 15 minutes less than the configured expire time.