<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Joe_noh</author_name>
  <author_url>https://blog.hatena.ne.jp/Joe_noh/</author_url>
  <blog_title>mmag</blog_title>
  <blog_url>https://joe-noh.hatenablog.com/</blog_url>
  <categories>
    <anon>Rails</anon>
  </categories>
  <description>Railsのキャッシュをまとめて消すときにRails.cache.delete_matchedが便利だった、というだけの話。 最初は Rails.cache.redis.keys.grep(/hello/).each do |key| Rails.cache.delete(key) end みたいなことをやりかけて、これはなんかミスってるでしょと思って調べたら出てきた。 Rails.cache.delete_matched('hello*') とかできます。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fjoe-noh.hatenablog.com%2Fentry%2F2022%2F03%2F28%2F190914&quot; title=&quot;Rails.cache.delete_matched - mmag&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-03-28 19:09:14</published>
  <title>Rails.cache.delete_matched</title>
  <type>rich</type>
  <url>https://joe-noh.hatenablog.com/entry/2022/03/28/190914</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
