Page MenuHomePhabricator

Snapshot: If datalayer loading fails, shorten caching
Closed, ResolvedPublic

Description

When creating a new map, the pageprops might not be available yet. To prevent base maps from showing for too long, we need to shorten their caching time.

Event Timeline

I've seen where maps take over an hour to update - this is hugely frustrating for anyone trying to build a map onto a page and not knowing if it'll look like they think it will, until the cache is flushed.

It seems the easiest solution would be to simply throw an error if MW api returns an error when requesting specific data, as that will indicate that either the map URL is incorrect, or that the prop-pages database replication is not yet finished. Varnish will not cache the error (or just do it for a few seconds to avoid complete server meltdown), and a simple page refresh will quickly get the data.

Done, we now throw a 400 error to indicate the data is still missing.