{"id":11358,"date":"2023-03-06T13:15:28","date_gmt":"2023-03-06T04:15:28","guid":{"rendered":"https:\/\/www.stuffy.site\/computers\/?p=11358"},"modified":"2023-03-16T16:54:33","modified_gmt":"2023-03-16T07:54:33","slug":"rediswordpress-redis-cli-flushall%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89","status":"publish","type":"post","link":"https:\/\/www.stuffy.site\/computers\/archives\/11358","title":{"rendered":"Redis@WordPress redis-cli flushall\u30b3\u30de\u30f3\u30c9"},"content":{"rendered":"\n<p>WordPress\u306e\u30ab\u30ec\u30f3\u30c0\u30fc\u304cRedis Object Cache\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5f8c\u304b\u3089\u8abf\u5b50\u304c\u60aa\u304b\u3063\u305f\u306e\u3067\u30b3\u30de\u30f3\u30c9\u304b\u3089\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3057\u305f\u3089\u3044\u3044\u611f\u3058\u3060\u3063\u305f\u306e\u3067\u3081\u3082\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Redis Object Cache\u306fWordpress\u30da\u30fc\u30b8\u306e\u8aad\u307f\u8fbc\u307f\u3092\u65e9\u304f\u3059\u308b\u305f\u3081\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\u3002<\/p>\n\n\n<pre><span style=\"font-size: 14pt; color: #0000ff;\"># dnf -y --enablerepo=remi install php-fpm php-pecl-redis5<br \/><br \/># dnf -y install redis<br \/>\n# systemctl enable --now redis<br \/><br \/># systemctl restart php-fpm<br \/><\/span><\/pre>\n<p>\u00a0<\/p>\n\n\n<p> \u4e0a\u8a18\u30b3\u30de\u30f3\u30c9\u3067Redis\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6709\u52b9\u306b\u306b\u3057\u3066 [\u30d7\u30e9\u30b0\u30a4\u30f3]-[\u65b0\u898f\u8ffd\u52a0] \u3067\u300cRedis Object Cache\u300d\u3092\u8ffd\u52a0\u3057\u3066\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u30ab\u30ec\u30f3\u30c0\u30fc\u66f4\u65b0\u4e0d\u5177\u5408\u306b\u5fc3\u75db\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3042\u308c\u3053\u308c\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u3068Redis\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3059\u308b\u3068\u826f\u3044\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/redis_flush_cache.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/redis_flush_cache.png\" alt=\"\" class=\"wp-image-11359\" width=\"428\" height=\"503\" srcset=\"https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/redis_flush_cache.png 571w, https:\/\/www.stuffy.site\/computers\/wp-content\/uploads\/2023\/03\/redis_flush_cache-256x300.png 256w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/a><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-right\">.<\/p>\n\n\n\n<p>\u3053\u308c\u3092 cron \u304b\u3089\u81ea\u52d5\u3067\u5b9f\u884c\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9\u304c redis-cli flushall \u3067\u3059\u3002\u6bce\u65e50:01 \u306b\u81ea\u52d5\u5b9f\u884c\u3059\u308b\u306b\u306f crontab -e \u3092\u7de8\u96c6\u3057\u3066\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067OK\u3067\u3059\u3002<\/p>\n\n\n<pre><span style=\"font-size: 14pt; color: #0000ff;\">crontab -e<\/span><br>\n1 0 * * * \/root\/redis-flush-cache.sh<br><br><span style=\"font-size: 14pt; color: #0000ff;\">vi \/root\/redis-flush-cache.sh<br><\/span><br>#!\/bin\/bash<br>\/usr\/bin\/redis-cli flushall async<\/pre>\n\n\n<p class=\"has-text-align-right\">.<\/p>\n\n\n\n<p>\u53c2\u8003URL : <a href=\"https:\/\/qiita.com\/reoring\/items\/b92cac4c83c88a725faa\">Redis\u306eKey\u3092\u5168\u3066\u524a\u9664\u3059\u308b &#8211; Qiita<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kinsta.com\/jp\/docs\/clear-site-cache\/#sshredis\"><a href=\"https:\/\/kinsta.com\/jp\/docs\/clear-site-cache\/#sshredis\">SSH\u3092\u4f7f\u7528\u3057\u3066Redis\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3059\u308b<\/a><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u306e\u30ab\u30ec\u30f3\u30c0\u30fc\u304cRedis Object Cache\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5f8c\u304b\u3089\u8abf\u5b50\u304c\u60aa\u304b\u3063\u305f\u306e\u3067\u30b3\u30de\u30f3\u30c9\u304b\u3089\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3057\u305f\u3089\u3044\u3044\u611f\u3058\u3060\u3063\u305f\u306e\u3067\u3081\u3082\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,4],"tags":[],"class_list":["post-11358","post","type-post","status-publish","format-standard","hentry","category-redis","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/11358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/comments?post=11358"}],"version-history":[{"count":11,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/11358\/revisions"}],"predecessor-version":[{"id":11528,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/posts\/11358\/revisions\/11528"}],"wp:attachment":[{"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/media?parent=11358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/categories?post=11358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stuffy.site\/computers\/wp-json\/wp\/v2\/tags?post=11358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}