I’m developing a small Onebox plugin and testing it in my production install.
It appears that Discourse is caching the Oneboxes: When I paste a link I once saw oneboxed into a new post, the preview is still looking as if it was generated by an older version of the plugin, while newer links appear as they should. All this is happening in the preview, I’m not actually posting the link.
В Redis CLI вы также можете удалять отдельные ключи, не очищая весь кэш Redis:
# ./launcher enter app
# redis-cli
> keys *CACHE:onebox*example.com*
1) `"default: CACHE:onebox__https://example.com/"`
> del "default: CACHE:onebox__https://example.com/"
(integer) 1
> keys *CACHE:onebox*example.com*
(empty list or set)
Я предполагаю, что эта схема ключей вряд ли будет часто меняться, но если это произойдет, вы можете просто использовать keys *onebox*url* или даже keys *url*, чтобы найти нужный кэшированный ключ для удаления…
Могу подтвердить, что мне удалось успешно удалить закэшированные onebox-элементы и пересоздать HTML для постов, затронутых поврежденными закэшированными данными, используя этот метод.