You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disable caching site-wide at all levels with a single flag or multiple flags.
Set the flags as default for new Next.js installations. (next.config.mjs)
Allow enabling of cache at any levels as per need.
Ensure zero changes for existing projects since their config files wouldn't have the future enduserCacheStrategy flag.
Non-Goals
Address performance issues directly.
Help with caching directly.
Change any other Next.js behavior.
Background
When we hire co-ops and new graduates, the first thing we teach them is to avoid premature optimization, often using the famous adage, "premature optimization is the root of all evil." Yet, Next.js is optimizing without understanding the specific architecture and design needs of the application. Next.js may have taken an undesired step by prematurely adopting a cache-everything strategy, while simultaneously creating numerous ways to disable caching in various places.
Proposal
Instead, Next.js architects and developers are encouraged to reverse this approach. By allowing the disabling of all caches at once through the configuration file; end users can then strategically cache what they need using in-file configurations / flags.
// next.config.mjsconstnextConfig={reactStrictMode: true,enduserCacheStrategy: true// let the end users decide on enabling cache strategically};exportdefaultnextConfig;
Please note, this request is to have an option to disable caching altogether, instead of updating all files with various flags.
Then end users can optimize as per need and business requirement.
The quality of experience is not optimal with the current cache-everything-by-default strategy.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
enduserCacheStrategy
flag.Non-Goals
Background
When we hire co-ops and new graduates, the first thing we teach them is to avoid premature optimization, often using the famous adage, "premature optimization is the root of all evil." Yet, Next.js is optimizing without understanding the specific architecture and design needs of the application. Next.js may have taken an undesired step by prematurely adopting a cache-everything strategy, while simultaneously creating numerous ways to disable caching in various places.
Proposal
Instead, Next.js architects and developers are encouraged to reverse this approach. By allowing the disabling of all caches at once through the configuration file; end users can then strategically cache what they need using in-file configurations / flags.
Please note, this request is to have an option to disable caching altogether, instead of updating all files with various flags.
Then end users can optimize as per need and business requirement.
The quality of experience is not optimal with the current
cache-everything-by-default
strategy.Beta Was this translation helpful? Give feedback.
All reactions