fefrei
(Felix Freiberger)
2월 24, 2016, 8:36오전
1
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.
How can I clear this cache?
Adding a rando querystring is usually the best quick & dirty way.
fefrei
(Felix Freiberger)
2월 24, 2016, 9:31오전
3
Yes, that works – but only to circumvent the cache for testing, not to clear it for end users.
Is there a way to really purge this cache? Does it expire eventually?
There’s always the option to redis-cli flushall.
Yup, it’ll automatically expire after 24 hours.
fefrei
(Felix Freiberger)
2월 24, 2016, 9:40오전
5
Great – this helps a lot. Thanks!
all the caches!
Be aware that flushing redis will clear sidekiq’s queue (and thus might end up losing some email notifications )
mcdanlj
(Michael K Johnson)
1월 18, 2021, 6:32오후
7
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을 다시 빌드한 것을 확인했습니다.