Delete the cache entry when the post is changed or deleted

This commit is contained in:
Michael 2022-09-06 21:51:47 +00:00
parent 7c9f10e58f
commit da658cbf1d
6 changed files with 38 additions and 9 deletions

View file

@ -196,6 +196,8 @@ class Item
$notify_items = [];
while ($item = DBA::fetch($items)) {
ActivityPub\PageCache::deleteByUriId($item['uri-id']);
if (!empty($fields['body'])) {
Post\Media::insertFromAttachmentData($item['uri-id'], $fields['body']);
@ -319,6 +321,8 @@ class Item
// clean up categories and tags so they don't end up as orphans
Post\Category::deleteByURIId($item['uri-id'], $item['uid']);
ActivityPub\PageCache::deleteByUriId($item['uri-id']);
/*
* If item is a link to a photo resource, nuke all the associated photos
* (visitors will not have photo resources)