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.
Nella CLI di Redis, puoi anche eliminare singoli chiavi senza svuotare l’intera cache 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)
Mi aspetto che questo schema di chiavi non cambi spesso, ma se dovesse accadere, puoi semplicemente usare keys *onebox*url* o anche keys *url* per cercare la chiave cache da eliminare…
Posso confermare di aver eliminato con successo le onebox in cache e ricostruito l’HTML per i post influenzati da dati corrotti in cache utilizzando questo metodo.