When trying to improve parser cache hit rates, we discovered that there are a lot of pages which expire at midnight (UTC or local) every night, due to pages which reference the YYMMDD date. This causes a big drop in cache hit rate every night (~20%). Looking at the level raw request rate (hit+miss) we can clarify that this isn't a nightly spider.
This could be solved partially by selective update (T373258), which could track which fragment was responsible for the reduced cache rate and just recompute that fragment.
But at the same time we could give wikitext/scribunto better date comparison tools. "Is this date in the past" is a comparison that, once true, will never not be true and shouldn't trigger further daily recomputes. (Improved templates could also be part of the cross-wiki code collab pilot.)
https://en.wikipedia.org/wiki/Module:Article_history/config#L-915 through line 1028 is what this looks like in practice currently. The call to getYmdDate at the top is what is causing the entire page to expire at midnight. [[Module:Article_history]] alone is used on 51,000 pages on enwiki.
The existing date code is just in mw.language.formatDate shipped with scribunto, and there is also {{CURRENTDATE}} in the parser: we should ship both a Lua version of this new function and a wikitext version.
We will probably also need to provide ways to identify pages which are currently cache-unfriendly and motivate conversion to the new parser function. Using a "Expires daily" tracking category might be a good start, but it might have too many pages in it.
As a straw proposal: a date-comparison function with an implicit "today", so that isTodayBefore(<2 weeks from now>) could intelligently set an expiry of <2 weeks from now> instead of <when today changes>. An optional second parameter would select "wiki local" or "utc" time. Similar isTodayAfter(<2 weeks from now>) and isTodayEqual(<future date>) can be provided, although they can be emulated by the user from the base function without loss of efficiency.
(I was also a little surprised to see these functions on enwiki using the UTC time instead of the "local" time, so the front page turns over with the UTC date. Maybe that makes sense given the global scope of enwiki. But for itwiki (eg) I'd expect that using an italian local timezone for "article of the day" would make more sense.)
Some additional discussion of the performance impact is in T416540#11592069. Here are some 30-day graphs to quantify the effect, and you can see the sharp daily drops in cache hit rate:



