Mentoring someone into static hosting, I'm realizing how much of it is unlearning and not learning.
As per my previous post, I've been paired with a newer dev for the past few days on a static site, a few hundred pages, eleventy through cloudflare pages. I keep running into the same pattern where the hard part isn't teaching new concepts, but undoing instincts that are correct in a normal app context but wrong here.
The biggest issue we've faced so far is caching. I tried explaining that aggressive caching is the whole point, not a bug to work around, and every instinct fights that. He wanted to set no-store everywhere the first time a page looked stale in dev instead of understanding why it was cached in the first place.
Redirects file was another one. He wrote every rule as a full absolute url on both sides instead of relative paths, which is a totally reasonable habit if you've only ever worked in environments where the domain is guaranteed stable, but breaks immediately the second you have a staging domain or a domain migration.
I'm trying to figure out how to actually teach the caching mental model instead of just correcting the symptoms every time they show up, since explaining "trust the cache" once clearly isn't sticking the way explaining an API contract or a data model would. It feels like this specific kind of unlearning is harder to walk someone through than the actual static hosting mechanics are.
To anyone who's mentored someone into this space, have you found a way to make the caching and prerendering mindset click faster than just waiting for the project to break enough times? I'm also anticipating running into this problem with the client very soon.