The contents of Wikibase entity pages can be retrieved through the Special:EntityData special page, whose contents are cached by default (for one hour, in production – $wgWBRepoSettings['dataCdnMaxAge']). When a revision is deleted, the contents of Special:EntityData are not purged from the cache, allowing others to still access this information.
For example, on Test Wikidata I added the information that the rebel base’s location is Dantooine, and then removed it again and deleted that revision. But because the Wikibase editing UI loads Special:EntityData by default (since T85499), the data is already in the cache, and can be retrieved from there:
$ curl -v https://test.wikidata.org/wiki/Special:EntityData/Q212688.json?revision=530580 | jq -r .entities.Q212688.claims.P286[0].mainsnak.datavalue.value.id … > GET /wiki/Special:EntityData/Q212688.json?revision=530580 HTTP/2 > Host: test.wikidata.org > user-agent: curl/7.68.0 > accept: */* > … < HTTP/2 200 < date: Thu, 13 Aug 2020 12:42:52 GMT … < last-modified: Thu, 13 Aug 2020 12:42:45 GMT < content-type: application/json; charset=UTF-8 < age: 187 < x-cache: cp3050 miss, cp3058 hit/11 < x-cache-status: hit-front < server-timing: cache;desc="hit-front" … < cache-control: private, s-maxage=0, max-age=0, must-revalidate … Q212689
I think we also don’t purge cached entity data when a whole page is deleted, but I haven’t tested that yet.
Acceptance Criteria
- Pages are purged when entity deletion happens (might already be done not checked)
- Pages are purged when revision deletion of specific revisions happens
Inspection notes
- Some of the mechanisms/code that were written (and are merged) from T242164 could be used.
- No extra extensions are needed for reproducing this (it is core wikibase)
- This can't easily be tested with a full cache setup, but could be tested with unit tests etc to make sure the purging code is called correctly.