{"id":3322,"date":"2025-03-24T08:46:27","date_gmt":"2025-03-23T23:46:27","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=3322"},"modified":"2025-03-24T08:46:57","modified_gmt":"2025-03-23T23:46:57","slug":"%e3%80%90%e5%ae%9f%e8%b7%b5%e3%82%ac%e3%82%a4%e3%83%89%e3%80%91php%e3%82%a8%e3%83%b3%e3%82%b8%e3%83%8b%e3%82%a2%e3%81%ae%e3%81%9f%e3%82%81%e3%81%aeredis-keys%e3%82%b3%e3%83%9e%e3%83%b3%e3%83%89","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=3322","title":{"rendered":"\u3010\u5b9f\u8df5\u30ac\u30a4\u30c9\u3011PHP\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u305f\u3081\u306eRedis keys\u30b3\u30de\u30f3\u30c9\u5b8c\u5168\u89e3\u8aac \u301c\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30d2\u30f3\u30c8\u4ed8\u304d\u301c"},"content":{"rendered":"\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"\u76ee\u6b21\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u790e\u77e5\u8b58<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c\u69cb\u6587\u3068\u52d5\u4f5c\u539f\u7406<\/a>      <\/li>      <li>        <a href=\"#i-2\">keys\u30b3\u30de\u30f3\u30c9\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-3\">keys\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u7d50\u679c\u306e\u89e3\u91c8\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-4\">PHP\u304b\u3089Redis keys\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-5\">PHP\u306eRedis\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/a>      <\/li>      <li>        <a href=\"#i-6\">\u57fa\u672c\u7684\u306a\u30ad\u30fc\u53d6\u5f97\u306e\u5b9f\u88c5\u4f8b<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-7\">\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u691c\u7d22\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-8\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u8df5\u7684\u306a\u4f7f\u7528\u4f8b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-9\">\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u3067\u306e\u30ad\u30fc\u691c\u7d22\u30d1\u30bf\u30fc\u30f3<\/a>      <\/li>      <li>        <a href=\"#i-10\">\u30ad\u30e3\u30c3\u30b7\u30e5\u5236\u5fa1\u3067\u306e\u6d3b\u7528\u65b9\u6cd5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-11\">\u30d0\u30c3\u30c1\u51e6\u7406\u3067\u306e\u52b9\u7387\u7684\u306a\u5b9f\u88c5\u4f8b<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-12\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u6ce8\u610f\u70b9\u3068\u4ee3\u66ff\u624b\u6bb5<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-13\">\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u74b0\u5883\u3067\u306e\u4f7f\u7528\u30ea\u30b9\u30af<\/a>      <\/li>      <li>        <a href=\"#i-14\">SCAN\u7cfb\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u305f\u5b89\u5168\u306a\u4ee3\u66ff\u6848<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-15\">\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306e\u52b9\u7387\u7684\u306a\u30ad\u30fc\u7ba1\u7406\u624b\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-16\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-17\">\u30ad\u30fc\u306e\u547d\u540d\u898f\u5247\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u8a2d\u8a08\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>      <\/li>      <li>        <a href=\"#i-18\">\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-19\">\u5b9f\u884c\u6642\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-20\">\u767a\u5c55\u7684\u306aRedis\u30ad\u30fc\u7ba1\u7406\u30c6\u30af\u30cb\u30c3\u30af<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-21\">Redis\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3067\u306e\u30ad\u30fc\u64cd\u4f5c<\/a>      <\/li>      <li>        <a href=\"#i-22\">Redis\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3067\u306e\u30ad\u30fc\u5206\u6563\u6226\u7565<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-23\">\u76e3\u8996\u3068\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u306e\u81ea\u52d5\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/a>      <\/li>    <\/ul>  <\/li><\/ul>\n      <a href=\"#\" class=\"sgb-toc-button js-toc-button\" rel=\"nofollow\" data-open-dialog=\"true\"><i class=\"fa fa-list\"><\/i><span class=\"sgb-toc-button__text\">\u76ee\u6b21\u3078<\/span><\/a>\n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u790e\u77e5\u8b58<\/h2>\n\n\n\n<p>Redis\u306f\u9ad8\u6027\u80fd\u306a\u30ad\u30fc\u30d0\u30ea\u30e5\u30fc\u30b9\u30c8\u30a2\u3068\u3057\u3066\u5e83\u304f\u5229\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u4e2d\u3067\u3082<code>keys<\/code>\u30b3\u30de\u30f3\u30c9\u306f\u3001\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u30ad\u30fc\u3092\u691c\u7d22\u30fb\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c\u69cb\u6587\u3068\u52d5\u4f5c\u539f\u7406<\/h3>\n\n\n\n<p><code>keys<\/code>\u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c\u69cb\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">KEYS pattern<\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306f\u6307\u5b9a\u3055\u308c\u305f\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u3059\u3079\u3066\u306e\u30ad\u30fc\u3092\u8fd4\u3057\u307e\u3059\u3002\u52d5\u4f5c\u306e\u7279\u5fb4\u3068\u3057\u3066\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5185\u306e\u3059\u3079\u3066\u306e\u30ad\u30fc\u3092\u30b9\u30ad\u30e3\u30f3\u3059\u308b<\/li>\n\n\n\n<li>\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u884c\u3044\u3001\u4e00\u81f4\u3059\u308b\u30ad\u30fc\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3059<\/li>\n\n\n\n<li>\u5b9f\u884c\u4e2d\u306f\u4ed6\u306e\u30b3\u30de\u30f3\u30c9\u3092\u30d6\u30ed\u30c3\u30af\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b<\/li>\n<\/ul>\n\n\n\n<p>\u57fa\u672c\u7684\u306a\u4f7f\u7528\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u3059\u3079\u3066\u306e\u30ad\u30fc\u3092\u53d6\u5f97\nKEYS *\n\n# \"user:\"\u3067\u59cb\u307e\u308b\u30ad\u30fc\u3092\u53d6\u5f97\nKEYS user:*\n\n# \"session:\"\u3067\u59cb\u307e\u308a\":active\"\u3067\u7d42\u308f\u308b\u30ad\u30fc\u3092\u53d6\u5f97\nKEYS session:*:active<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">keys\u30b3\u30de\u30f3\u30c9\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0<\/h3>\n\n\n\n<p><code>keys<\/code>\u30b3\u30de\u30f3\u30c9\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b0\u30ed\u30d6\u30b9\u30bf\u30a4\u30eb\u306e\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u304c\u4f7f\u7528\u53ef\u80fd\u3067\u3059\uff1a<\/p>\n\n\n<div id=\"id-c4a1b56e-67c0-4913-993e-644d88e197cd\">\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u30d1\u30bf\u30fc\u30f3<\/th><th>\u8aac\u660e<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead><tbody><tr><td><code>*<\/code><\/td><td>0\u500b\u4ee5\u4e0a\u306e\u4efb\u610f\u306e\u6587\u5b57\u306b\u30de\u30c3\u30c1<\/td><td><code>KEYS user:*<\/code><\/td><\/tr><tr><td><code>?<\/code><\/td><td>\u4efb\u610f\u306e1\u6587\u5b57\u306b\u30de\u30c3\u30c1<\/td><td><code>KEYS user:???<\/code><\/td><\/tr><tr><td><code>[]<\/code><\/td><td>\u62ec\u5f27\u5185\u306e\u4efb\u610f\u306e1\u6587\u5b57\u306b\u30de\u30c3\u30c1<\/td><td><code>KEYS user:[123]<\/code><\/td><\/tr><tr><td><code>\\<\/code><\/td><td>\u7279\u6b8a\u6587\u5b57\u306e\u30a8\u30b9\u30b1\u30fc\u30d7<\/td><td><code>KEYS \\*name\\*<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n\n\n<p>\u5b9f\u8df5\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u30e6\u30fc\u30b6\u30fcID\u304c3\u6841\u306e\u30e6\u30fc\u30b6\u30fc\u30ad\u30fc\u3092\u691c\u7d22\nKEYS user:???\n\n# \u30bb\u30c3\u30b7\u30e7\u30f3ID\u304c\u7279\u5b9a\u306e\u7bc4\u56f2\u5185\u306e\u3082\u306e\u3092\u691c\u7d22\nKEYS session:[1-5]*\n\n# \u30ad\u30e3\u30c3\u30b7\u30e5\u30ad\u30fc\u3067\u7279\u5b9a\u306e\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u6301\u3064\u3082\u306e\u3092\u691c\u7d22\nKEYS cache:product:*<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-3\">keys\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u7d50\u679c\u306e\u89e3\u91c8\u65b9\u6cd5<\/h3>\n\n\n\n<p><code>keys<\/code>\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u7d50\u679c\u306f\u3001\u30de\u30c3\u30c1\u3057\u305f\u30ad\u30fc\u306e\u914d\u5217\u3068\u3057\u3066\u8fd4\u3055\u308c\u307e\u3059\u3002\u7d50\u679c\u306e\u89e3\u91c8\u306b\u304a\u3044\u3066\u6ce8\u610f\u3059\u3079\u304d\u70b9\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5b9f\u884c\u7d50\u679c\u306e\u9806\u5e8f<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8fd4\u3055\u308c\u308b\u30ad\u30fc\u306e\u9806\u5e8f\u306f\u4fdd\u8a3c\u3055\u308c\u306a\u3044<\/li>\n\n\n\n<li>\u6bce\u56de\u306e\u5b9f\u884c\u3067\u7570\u306a\u308b\u9806\u5e8f\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u7a7a\u306e\u7d50\u679c\u306e\u89e3\u91c8<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30de\u30c3\u30c1\u3059\u308b\u30ad\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u7a7a\u306e\u914d\u5217\u304c\u8fd4\u3055\u308c\u308b<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u3067\u306f\u306a\u304f\u6b63\u5e38\u306a\u7d50\u679c\u3068\u3057\u3066\u6271\u3046<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u7d50\u679c\u306e\u30b5\u30a4\u30ba<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30de\u30c3\u30c1\u3059\u308b\u30ad\u30fc\u304c\u591a\u6570\u3042\u308b\u5834\u5408\u3001\u7d50\u679c\u304c\u975e\u5e38\u306b\u5927\u304d\u304f\u306a\u308b\u53ef\u80fd\u6027<\/li>\n\n\n\n<li>\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306b\u6ce8\u610f\u304c\u5fc5\u8981<\/li>\n<\/ul>\n\n\n\n<p>\u5b9f\u884c\u7d50\u679c\u306e\u4f8b\u3068\u89e3\u91c8\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># \u30b3\u30de\u30f3\u30c9\u5b9f\u884c\n127.0.0.1:6379&gt; KEYS user:*\n\n# \u7d50\u679c\u4f8b\n1) \"user:1001\"\n2) \"user:1002:profile\"\n3) \"user:1003:settings\"<\/pre>\n\n\n\n<p>\u3053\u306e\u7d50\u679c\u304b\u3089\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30e6\u30fc\u30b6\u30fc\u95a2\u9023\u306e\u30ad\u30fc\u304c3\u3064\u5b58\u5728\u3059\u308b<\/li>\n\n\n\n<li>\u7570\u306a\u308b\u5f62\u5f0f\u306e\u30ad\u30fc\u304c\u6df7\u5728\u3057\u3066\u3044\u308b<\/li>\n\n\n\n<li>\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u4e00\u8cab\u6027\u3092\u78ba\u8a8d\u3067\u304d\u308b<\/li>\n<\/ul>\n\n\n\n<p>\u5b9f\u52d9\u4e0a\u306e\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5927\u898f\u6a21\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306e\u4f7f\u7528\u306f\u907f\u3051\u308b<\/li>\n\n\n\n<li>\u30c7\u30d0\u30c3\u30b0\u3084\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u76ee\u7684\u3067\u306e\u4f7f\u7528\u3092\u63a8\u5968<\/li>\n\n\n\n<li>\u672c\u756a\u74b0\u5883\u3067\u306f\u4ee3\u66ff\u30b3\u30de\u30f3\u30c9\uff08SCAN\u7b49\uff09\u306e\u4f7f\u7528\u3092\u691c\u8a0e<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-4\">PHP\u304b\u3089Redis keys\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5<\/h2>\n\n\n\n<p>PHP\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Redis\u3092\u52b9\u7387\u7684\u306b\u6d3b\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u9069\u5207\u306a\u8a2d\u5b9a\u3068\u5b9f\u88c5\u304c\u91cd\u8981\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u3001PHP\u304b\u3089Redis keys\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u5177\u4f53\u7684\u306a\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-5\">PHP\u306eRedis\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3068\u8a2d\u5b9a<\/h3>\n\n\n\n<p>PHP\u3067Redis\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001\u4e3b\u306b\u4ee5\u4e0b\u306e2\u3064\u306e\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>PHPRedis\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\uff08\u63a8\u5968\uff09<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Ubuntu\u306e\u5834\u5408\nsudo apt-get install php-redis\n\n# CentOS\u306e\u5834\u5408\nsudo yum install php-pecl-redis<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Composer\u3092\u4f7f\u7528\u3057\u305fPredis\u30e9\u30a4\u30d6\u30e9\u30ea<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">composer require predis\/predis<\/pre>\n\n\n\n<p>\u8a2d\u5b9a\u4f8b\uff08php.ini\uff09\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">extension=redis.so\nredis.session.locking_enabled=1\nredis.session.lock_expire=60<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-6\">\u57fa\u672c\u7684\u306a\u30ad\u30fc\u53d6\u5f97\u306e\u5b9f\u88c5\u4f8b<\/h3>\n\n\n\n<p>PHPRedis\u62e1\u5f35\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u4f7f\u7528\u3057\u305f\u57fa\u672c\u7684\u306a\u5b9f\u88c5\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n\/\/ Redis\u3078\u306e\u63a5\u7d9a\n$redis = new Redis();\n$redis-&gt;connect('127.0.0.1', 6379);\n\ntry {\n    \/\/ \u5168\u3066\u306e\u30ad\u30fc\u3092\u53d6\u5f97\n    $allKeys = $redis-&gt;keys('*');\n\n    \/\/ \u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u30ad\u30fc\u3092\u53d6\u5f97\n    $userKeys = $redis-&gt;keys('user:*');\n\n    \/\/ \u53d6\u5f97\u3057\u305f\u30ad\u30fc\u306e\u51e6\u7406\n    foreach ($userKeys as $key) {\n        $value = $redis-&gt;get($key);\n        echo \"Key: $key, Value: $value\\n\";\n    }\n} catch (RedisException $e) {\n    error_log(\"Redis error: \" . $e-&gt;getMessage());\n}<\/pre>\n\n\n\n<p>Predis\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nrequire 'vendor\/autoload.php';\n\n$client = new Predis\\Client([\n    'scheme' =&gt; 'tcp',\n    'host'   =&gt; '127.0.0.1',\n    'port'   =&gt; 6379,\n]);\n\ntry {\n    $keys = $client-&gt;keys('user:*');\n    foreach ($keys as $key) {\n        $value = $client-&gt;get($key);\n        echo \"Key: $key, Value: $value\\n\";\n    }\n} catch (Predis\\Response\\ServerException $e) {\n    error_log(\"Predis error: \" . $e-&gt;getMessage());\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-7\">\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u6d3b\u7528\u3057\u305f\u9ad8\u5ea6\u306a\u691c\u7d22\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u3088\u308a\u8907\u96d1\u306a\u30ad\u30fc\u691c\u7d22\u30d1\u30bf\u30fc\u30f3\u306e\u5b9f\u88c5\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisKeyManager {\n    private $redis;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u6307\u5b9a\u3055\u308c\u305f\u65e5\u4ed8\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u30ad\u30fc\u3092\u53d6\u5f97\n     * @param string $date Y-m-d\u5f62\u5f0f\u306e\u65e5\u4ed8\n     * @return array\n     *\/\n    public function getSessionKeysByDate(string $date): array {\n        $pattern = \"session:{$date}:*\";\n        return $this-&gt;redis-&gt;keys($pattern);\n    }\n\n    \/**\n     * \u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u95a2\u9023\u3059\u308b\u5168\u3066\u306e\u30ad\u30fc\u3092\u53d6\u5f97\n     * @param int $userId \u30e6\u30fc\u30b6\u30fcID\n     * @return array\n     *\/\n    public function getAllUserRelatedKeys(int $userId): array {\n        $patterns = [\n            \"user:{$userId}:*\",\n            \"profile:{$userId}:*\",\n            \"settings:{$userId}:*\"\n        ];\n\n        $allKeys = [];\n        foreach ($patterns as $pattern) {\n            $keys = $this-&gt;redis-&gt;keys($pattern);\n            $allKeys = array_merge($allKeys, $keys);\n        }\n\n        return array_unique($allKeys);\n    }\n\n    \/**\n     * \u6709\u52b9\u671f\u9650\u5207\u308c\u306e\u53ef\u80fd\u6027\u304c\u3042\u308b\u30ad\u30fc\u3092\u691c\u7d22\n     * @param int $thresholdDays \u671f\u9650\u5207\u308c\u3068\u307f\u306a\u3059\u65e5\u6570\n     * @return array\n     *\/\n    public function findPotentiallyExpiredKeys(int $thresholdDays): array {\n        $pattern = \"cache:*\";\n        $keys = $this-&gt;redis-&gt;keys($pattern);\n        $expiredKeys = [];\n\n        foreach ($keys as $key) {\n            $ttl = $this-&gt;redis-&gt;ttl($key);\n            if ($ttl &gt; 0 &amp;&amp; $ttl &lt; ($thresholdDays * 86400)) {\n                $expiredKeys[] = $key;\n            }\n        }\n\n        return $expiredKeys;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$redis = new Redis();\n$redis-&gt;connect('127.0.0.1', 6379);\n$manager = new RedisKeyManager($redis);\n\n\/\/ \u4eca\u65e5\u306e\u30bb\u30c3\u30b7\u30e7\u30f3\u30ad\u30fc\u3092\u53d6\u5f97\n$todayKeys = $manager-&gt;getSessionKeysByDate(date('Y-m-d'));\n\n\/\/ \u30e6\u30fc\u30b6\u30fc\u95a2\u9023\u306e\u5168\u30ad\u30fc\u3092\u53d6\u5f97\n$userKeys = $manager-&gt;getAllUserRelatedKeys(1001);\n\n\/\/ 3\u65e5\u4ee5\u5185\u306b\u671f\u9650\u5207\u308c\u306b\u306a\u308b\u30ad\u30fc\u3092\u691c\u7d22\n$expiringKeys = $manager-&gt;findPotentiallyExpiredKeys(3);<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5b9f\u88c5\u4f8b\u306f\u3001\u5b9f\u969b\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f7f\u7528\u3059\u308b\u969b\u306e\u57fa\u672c\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u672c\u756a\u74b0\u5883\u3067\u306e\u4f7f\u7528\u6642\u306b\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u30b9\u30b1\u30fc\u30e9\u30d3\u30ea\u30c6\u30a3\u3092\u8003\u616e\u3057\u3066\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066SCAN\u30b3\u30de\u30f3\u30c9\u3078\u306e\u7f6e\u304d\u63db\u3048\u3092\u691c\u8a0e\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-8\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u8df5\u7684\u306a\u4f7f\u7528\u4f8b<\/h2>\n\n\n\n<p>\u5b9f\u52d9\u3067Redis keys\u30b3\u30de\u30f3\u30c9\u3092\u6d3b\u7528\u3059\u308b\u5177\u4f53\u7684\u306a\u30b7\u30ca\u30ea\u30aa\u3068\u5b9f\u88c5\u65b9\u6cd5\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u3067\u306e\u30ad\u30fc\u691c\u7d22\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u306f\u3001Redis\u306e\u4e00\u822c\u7684\u306a\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306e1\u3064\u3067\u3059\u3002\u4ee5\u4e0b\u306b\u3001\u52b9\u7387\u7684\u306a\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u306e\u5b9f\u88c5\u4f8b\u3092\u793a\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass SessionManager {\n    private $redis;\n    private const SESSION_PREFIX = 'session:';\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u30a2\u30af\u30c6\u30a3\u30d6\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u7ba1\u7406\n     *\/\n    public function manageActiveSessions(): array {\n        $result = [\n            'active' =&gt; 0,\n            'expired' =&gt; 0,\n            'cleaned' =&gt; 0\n        ];\n\n        \/\/ \u30a2\u30af\u30c6\u30a3\u30d6\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u691c\u7d22\n        $activePattern = self::SESSION_PREFIX . '*:active';\n        $activeSessions = $this-&gt;redis-&gt;keys($activePattern);\n        $result['active'] = count($activeSessions);\n\n        \/\/ \u671f\u9650\u5207\u308c\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u691c\u51fa\u3068\u524a\u9664\n        $expiredPattern = self::SESSION_PREFIX . '*:expired';\n        $expiredSessions = $this-&gt;redis-&gt;keys($expiredPattern);\n        $result['expired'] = count($expiredSessions);\n\n        \/\/ \u53e4\u3044\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\n        foreach ($expiredSessions as $session) {\n            $this-&gt;redis-&gt;del($session);\n            $result['cleaned']++;\n        }\n\n        return $result;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-10\">\u30ad\u30e3\u30c3\u30b7\u30e5\u5236\u5fa1\u3067\u306e\u6d3b\u7528\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u30ad\u30e3\u30c3\u30b7\u30e5\u30b7\u30b9\u30c6\u30e0\u3067\u306eRedis keys\u306e\u52b9\u679c\u7684\u306a\u4f7f\u7528\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass CacheManager {\n    private $redis;\n    private const CACHE_PREFIX = 'cache:';\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u7279\u5b9a\u306e\u30ab\u30c6\u30b4\u30ea\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u4e00\u62ec\u524a\u9664\n     *\/\n    public function clearCategoryCache(string $category): int {\n        $pattern = self::CACHE_PREFIX . $category . ':*';\n        $keys = $this-&gt;redis-&gt;keys($pattern);\n\n        $cleared = 0;\n        if (!empty($keys)) {\n            $cleared = $this-&gt;redis-&gt;del($keys);\n        }\n\n        return $cleared;\n    }\n\n    \/**\n     * \u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u6709\u52b9\u671f\u9650\u3092\u78ba\u8a8d\u3057\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u66f4\u65b0\n     *\/\n    public function refreshCacheIfNeeded(string $category, int $thresholdHours = 24): array {\n        $pattern = self::CACHE_PREFIX . $category . ':*';\n        $keys = $this-&gt;redis-&gt;keys($pattern);\n        $result = ['total' =&gt; count($keys), 'refreshed' =&gt; 0];\n\n        foreach ($keys as $key) {\n            $ttl = $this-&gt;redis-&gt;ttl($key);\n            if ($ttl &gt; 0 &amp;&amp; $ttl &lt; ($thresholdHours * 3600)) {\n                \/\/ TTL\u3092\u5ef6\u9577\n                $this-&gt;redis-&gt;expire($key, $thresholdHours * 3600);\n                $result['refreshed']++;\n            }\n        }\n\n        return $result;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-11\">\u30d0\u30c3\u30c1\u51e6\u7406\u3067\u306e\u52b9\u7387\u7684\u306a\u5b9f\u88c5\u4f8b<\/h3>\n\n\n\n<p>\u5927\u898f\u6a21\u306a\u30c7\u30fc\u30bf\u51e6\u7406\u3092\u884c\u3046\u30d0\u30c3\u30c1\u51e6\u7406\u3067\u306e\u5b9f\u88c5\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass BatchProcessor {\n    private $redis;\n    private const BATCH_PREFIX = 'batch:';\n    private const CHUNK_SIZE = 1000;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u30d0\u30c3\u30c1\u51e6\u7406\u306e\u9032\u6357\u7ba1\u7406\n     *\/\n    public function processBatchJobs(string $jobType): array {\n        $pattern = self::BATCH_PREFIX . $jobType . ':*';\n        $allKeys = $this-&gt;redis-&gt;keys($pattern);\n        $totalKeys = count($allKeys);\n\n        $result = [\n            'total' =&gt; $totalKeys,\n            'processed' =&gt; 0,\n            'failed' =&gt; 0,\n            'chunks' =&gt; ceil($totalKeys \/ self::CHUNK_SIZE)\n        ];\n\n        \/\/ \u30c1\u30e3\u30f3\u30af\u5358\u4f4d\u3067\u306e\u51e6\u7406\n        foreach (array_chunk($allKeys, self::CHUNK_SIZE) as $chunk) {\n            try {\n                \/\/ \u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u4e00\u62ec\u51e6\u7406\n                $pipe = $this-&gt;redis-&gt;multi(Redis::PIPELINE);\n                foreach ($chunk as $key) {\n                    $pipe-&gt;get($key);\n                    $pipe-&gt;del($key);\n                }\n                $responses = $pipe-&gt;exec();\n\n                $result['processed'] += count($chunk);\n            } catch (RedisException $e) {\n                $result['failed'] += count($chunk);\n                error_log(\"Batch processing error: \" . $e-&gt;getMessage());\n            }\n        }\n\n        return $result;\n    }\n\n    \/**\n     * \u5931\u6557\u3057\u305f\u30b8\u30e7\u30d6\u306e\u518d\u51e6\u7406\n     *\/\n    public function retryFailedJobs(string $jobType): array {\n        $pattern = self::BATCH_PREFIX . $jobType . ':failed:*';\n        $failedKeys = $this-&gt;redis-&gt;keys($pattern);\n\n        $result = [\n            'total_failed' =&gt; count($failedKeys),\n            'retried' =&gt; 0,\n            'succeeded' =&gt; 0\n        ];\n\n        foreach ($failedKeys as $key) {\n            try {\n                $jobData = $this-&gt;redis-&gt;get($key);\n                if ($this-&gt;processJob($jobData)) {\n                    $this-&gt;redis-&gt;del($key);\n                    $result['succeeded']++;\n                }\n                $result['retried']++;\n            } catch (Exception $e) {\n                error_log(\"Retry failed for key {$key}: \" . $e-&gt;getMessage());\n            }\n        }\n\n        return $result;\n    }\n\n    private function processJob($jobData): bool {\n        \/\/ \u30b8\u30e7\u30d6\u56fa\u6709\u306e\u51e6\u7406\u30ed\u30b8\u30c3\u30af\n        return true; \/\/ \u51e6\u7406\u6210\u529f\u3092\u793a\u3059\u30c0\u30df\u30fc\u5b9f\u88c5\n    }\n}<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5b9f\u88c5\u4f8b\u306f\u3001\u4ee5\u4e0b\u306e\u91cd\u8981\u306a\u5b9f\u8df5\u7684\u30dd\u30a4\u30f3\u30c8\u3092\u793a\u3057\u3066\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u660e\u78ba\u306a\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u306e\u4f7f\u7528<\/li>\n\n\n\n<li>\u968e\u5c64\u7684\u306a\u30ad\u30fc\u69cb\u9020\u306e\u63a1\u7528<\/li>\n\n\n\n<li>\u610f\u56f3\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u547d\u540d\u898f\u5247<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30a8\u30e9\u30fc\u51e6\u7406<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f8b\u5916\u306e\u9069\u5207\u306a\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u30ed\u30b0\u306e\u8a18\u9332<\/li>\n\n\n\n<li>\u30ea\u30c8\u30e9\u30a4\u30e1\u30ab\u30cb\u30ba\u30e0\u306e\u5b9f\u88c5<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8003\u616e<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30c1\u30e3\u30f3\u30af\u51e6\u7406\u306e\u5c0e\u5165<\/li>\n\n\n\n<li>\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u306e\u6d3b\u7528<\/li>\n\n\n\n<li>\u9069\u5207\u306a\u30d0\u30c3\u30c1\u30b5\u30a4\u30ba\u306e\u8a2d\u5b9a<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u5fdc\u7528\u53ef\u80fd\u306a\u57fa\u672c\u7684\u306a\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u5177\u4f53\u7684\u306a\u8981\u4ef6\u306b\u5fdc\u3058\u3066\u9069\u5207\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-12\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u6ce8\u610f\u70b9\u3068\u4ee3\u66ff\u624b\u6bb5<\/h2>\n\n\n\n<p>Redis keys\u30b3\u30de\u30f3\u30c9\u306f\u4fbf\u5229\u306a\u6a5f\u80fd\u3067\u3059\u304c\u3001\u672c\u756a\u74b0\u5883\u3067\u306e\u4f7f\u7528\u306b\u306f\u91cd\u8981\u306a\u8003\u616e\u70b9\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u3001\u4e3b\u306a\u6ce8\u610f\u70b9\u3068\u63a8\u5968\u3055\u308c\u308b\u4ee3\u66ff\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-13\">\u30d7\u30ed\u30c0\u30af\u30b7\u30e7\u30f3\u74b0\u5883\u3067\u306e\u4f7f\u7528\u30ea\u30b9\u30af<\/h3>\n\n\n\n<p>keys\u30b3\u30de\u30f3\u30c9\u3092\u672c\u756a\u74b0\u5883\u3067\u4f7f\u7528\u3059\u308b\u969b\u306e\u4e3b\u306a\u30ea\u30b9\u30af\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u5f71\u97ff<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5168\u4f53\u306e\u30b9\u30ad\u30e3\u30f3\u304c\u5fc5\u8981<\/li>\n\n\n\n<li>\u4ed6\u306e\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u304c\u30d6\u30ed\u30c3\u30af\u3055\u308c\u308b\u53ef\u80fd\u6027<\/li>\n\n\n\n<li>\u30ec\u30b9\u30dd\u30f3\u30b9\u6642\u9593\u306e\u5897\u52a0<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5927\u91cf\u306e\u30ad\u30fc\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u7d50\u679c\u30bb\u30c3\u30c8\u304c\u5927\u304d\u304f\u306a\u308b<\/li>\n\n\n\n<li>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u30e1\u30e2\u30ea\u6d88\u8cbb\u304c\u5897\u52a0<\/li>\n\n\n\n<li>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5e2f\u57df\u5e45\u306e\u6d88\u8cbb<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30b7\u30b9\u30c6\u30e0\u306e\u5b89\u5b9a\u6027<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306e\u5b9f\u884c\u6642\u9593\u304c\u4e88\u6e2c\u4e0d\u80fd<\/li>\n\n\n\n<li>\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3067\u306e\u5f71\u97ff\u304c\u8907\u96d1<\/li>\n\n\n\n<li>\u4ed6\u306e\u30aa\u30da\u30ec\u30fc\u30b7\u30e7\u30f3\u3078\u306e\u5e72\u6e09<\/li>\n<\/ul>\n\n\n\n<p>\u30ea\u30b9\u30af\u8efd\u6e1b\u306e\u305f\u3081\u306e\u5bfe\u7b56\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass SafeRedisOperations {\n    private $redis;\n    private const MAX_KEYS = 10000;\n    private const TIMEOUT_SECONDS = 5;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u5b89\u5168\u306a\u30ad\u30fc\u691c\u7d22\u306e\u5b9f\u88c5\u4f8b\n     *\/\n    public function safeKeySearch(string $pattern): array {\n        \/\/ \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u306e\u8a2d\u5b9a\n        $this-&gt;redis-&gt;setex('operation:timeout', self::TIMEOUT_SECONDS, 1);\n\n        try {\n            $keys = $this-&gt;redis-&gt;keys($pattern);\n\n            if (count($keys) &gt; self::MAX_KEYS) {\n                throw new RuntimeException(\n                    \"Too many keys returned: \" . count($keys)\n                );\n            }\n\n            return $keys;\n        } catch (RedisException $e) {\n            error_log(\"Redis operation failed: \" . $e-&gt;getMessage());\n            return [];\n        } finally {\n            $this-&gt;redis-&gt;del('operation:timeout');\n        }\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-14\">SCAN\u7cfb\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u305f\u5b89\u5168\u306a\u4ee3\u66ff\u6848<\/h3>\n\n\n\n<p>SCAN\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u305f\u5b89\u5168\u306a\u5b9f\u88c5\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass ScanBasedKeysFinder {\n    private $redis;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * SCAN\u3092\u4f7f\u7528\u3057\u305f\u30ad\u30fc\u691c\u7d22\u306e\u5b9f\u88c5\n     *\/\n    public function findKeys(string $pattern): array {\n        $keys = [];\n        $iterator = null;\n\n        do {\n            \/\/ SCAN\u306e\u5b9f\u884c\n            $result = $this-&gt;redis-&gt;scan($iterator, [\n                'match' =&gt; $pattern,\n                'count' =&gt; 100\n            ]);\n\n            if ($result === false) {\n                break;\n            }\n\n            \/\/ \u898b\u3064\u304b\u3063\u305f\u30ad\u30fc\u3092\u8ffd\u52a0\n            foreach ($result as $key) {\n                $keys[] = $key;\n            }\n        } while ($iterator &gt; 0);\n\n        return $keys;\n    }\n\n    \/**\n     * \u975e\u540c\u671f\u51e6\u7406\u3092\u6d3b\u7528\u3057\u305fSCAN\u5b9f\u88c5\n     *\/\n    public function asyncFindKeys(string $pattern): Generator {\n        $iterator = null;\n\n        do {\n            $result = $this-&gt;redis-&gt;scan($iterator, [\n                'match' =&gt; $pattern,\n                'count' =&gt; 100\n            ]);\n\n            if ($result === false) {\n                break;\n            }\n\n            foreach ($result as $key) {\n                yield $key;\n            }\n        } while ($iterator &gt; 0);\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$finder = new ScanBasedKeysFinder($redis);\n\n\/\/ \u540c\u671f\u7684\u306a\u4f7f\u7528\n$keys = $finder-&gt;findKeys('user:*');\n\n\/\/ \u975e\u540c\u671f\u7684\u306a\u4f7f\u7528\nforeach ($finder-&gt;asyncFindKeys('user:*') as $key) {\n    \/\/ \u30ad\u30fc\u3054\u3068\u306e\u51e6\u7406\n    processKey($key);\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-15\">\u5927\u898f\u6a21\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u306e\u52b9\u7387\u7684\u306a\u30ad\u30fc\u7ba1\u7406\u624b\u6cd5<\/h3>\n\n\n\n<p>\u5927\u898f\u6a21\u30b7\u30b9\u30c6\u30e0\u3067\u306e\u30ad\u30fc\u7ba1\u7406\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30ad\u30fc\u306e\u69cb\u9020\u5316\u7ba1\u7406<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass StructuredKeyManager {\n    private $redis;\n\n    \/**\n     * \u30ad\u30fc\u968e\u5c64\u306e\u5b9a\u7fa9\n     *\/\n    private const KEY_HIERARCHY = [\n        'user' =&gt; [\n            'profile' =&gt; 'user:{id}:profile',\n            'settings' =&gt; 'user:{id}:settings',\n            'sessions' =&gt; 'user:{id}:sessions'\n        ],\n        'cache' =&gt; [\n            'product' =&gt; 'cache:product:{id}',\n            'category' =&gt; 'cache:category:{id}'\n        ]\n    ];\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u69cb\u9020\u5316\u3055\u308c\u305f\u30ad\u30fc\u306e\u751f\u6210\n     *\/\n    public function generateKey(string $type, string $subtype, array $params): string {\n        if (!isset(self::KEY_HIERARCHY[$type][$subtype])) {\n            throw new InvalidArgumentException('Invalid key type or subtype');\n        }\n\n        $template = self::KEY_HIERARCHY[$type][$subtype];\n        return strtr($template, array_map(\n            fn($v) =&gt; (string)$v,\n            array_combine(\n                array_map(fn($k) =&gt; '{' . $k . '}', array_keys($params)),\n                array_values($params)\n            )\n        ));\n    }\n\n    \/**\n     * \u30ad\u30fc\u691c\u7d22\u306e\u6700\u9069\u5316\n     *\/\n    public function findRelatedKeys(string $type, string $subtype, array $params): Generator {\n        $pattern = $this-&gt;generateKey($type, $subtype, $params);\n        $iterator = null;\n\n        do {\n            $keys = $this-&gt;redis-&gt;scan($iterator, [\n                'match' =&gt; $pattern,\n                'count' =&gt; 100\n            ]);\n\n            if ($keys === false) {\n                break;\n            }\n\n            foreach ($keys as $key) {\n                yield $key;\n            }\n        } while ($iterator &gt; 0);\n    }\n}<\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u5206\u6563\u30b7\u30b9\u30c6\u30e0\u3067\u306e\u8003\u616e\u4e8b\u9805<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30ad\u30fc\u306e\u4e00\u8cab\u6027\u306e\u7dad\u6301<\/li>\n\n\n\n<li>\u30af\u30e9\u30b9\u30bf\u5bfe\u5fdc\u306e\u8a2d\u8a08<\/li>\n\n\n\n<li>\u30b7\u30e3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u8003\u616e\u3057\u305f\u30ad\u30fc\u8a2d\u8a08<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u4ee3\u66ff\u30a2\u30d7\u30ed\u30fc\u30c1\u3068\u6700\u9069\u5316\u624b\u6cd5\u3092\u9069\u5207\u306b\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u672c\u756a\u74b0\u5883\u3067\u3082\u5b89\u5168\u304b\u3064\u52b9\u7387\u7684\u306a\u30ad\u30fc\u7ba1\u7406\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-16\">Redis keys\u30b3\u30de\u30f3\u30c9\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316<\/h2>\n\n\n\n<p>Redis\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u305f\u3081\u3001\u30ad\u30fc\u7ba1\u7406\u306b\u304a\u3051\u308b\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af\u3092\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-17\">\u30ad\u30fc\u306e\u547d\u540d\u898f\u5247\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u8a2d\u8a08\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h3>\n\n\n\n<p>\u52b9\u7387\u7684\u306a\u30ad\u30fc\u7ba1\u7406\u306e\u305f\u3081\u306e\u547d\u540d\u898f\u5247\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u8a2d\u8a08\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass OptimizedKeyManager {\n    private $redis;\n\n    \/**\n     * \u30ad\u30fc\u8a2d\u8a08\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u5b9f\u88c5\u3057\u305f\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\n     *\/\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u6d3b\u7528\u3057\u305f\u30ad\u30fc\u7ba1\u7406\n     *\/\n    public function createIndexedKey(string $entity, string $id, array $metadata = []): string {\n        \/\/ \u30ad\u30fc\u968e\u5c64\u306e\u5b9a\u7fa9\n        $baseKey = sprintf('%s:%s', $entity, $id);\n\n        \/\/ \u30e1\u30bf\u30c7\u30fc\u30bf\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u4f5c\u6210\n        if (!empty($metadata)) {\n            foreach ($metadata as $key =&gt; $value) {\n                $indexKey = sprintf('index:%s:%s:%s', $entity, $key, $value);\n                $this-&gt;redis-&gt;sAdd($indexKey, $baseKey);\n            }\n        }\n\n        return $baseKey;\n    }\n\n    \/**\n     * \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u7528\u3057\u305f\u52b9\u7387\u7684\u306a\u691c\u7d22\n     *\/\n    public function findByMetadata(string $entity, array $criteria): array {\n        $indexKeys = [];\n        foreach ($criteria as $key =&gt; $value) {\n            $indexKeys[] = sprintf('index:%s:%s:%s', $entity, $key, $value);\n        }\n\n        \/\/ \u8907\u6570\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304b\u3089\u306e\u5171\u901a\u30ad\u30fc\u3092\u53d6\u5f97\n        if (count($indexKeys) &gt; 1) {\n            return $this-&gt;redis-&gt;sInter($indexKeys);\n        }\n\n        return $this-&gt;redis-&gt;sMembers($indexKeys[0]);\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$manager = new OptimizedKeyManager($redis);\n\n\/\/ \u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u306e\u4fdd\u5b58\n$userId = '1001';\n$metadata = [\n    'status' =&gt; 'active',\n    'role' =&gt; 'admin',\n    'region' =&gt; 'asia'\n];\n\n$key = $manager-&gt;createIndexedKey('user', $userId, $metadata);\n\n\/\/ \u30e1\u30bf\u30c7\u30fc\u30bf\u306b\u3088\u308b\u691c\u7d22\n$activeAdmins = $manager-&gt;findByMetadata('user', [\n    'status' =&gt; 'active',\n    'role' =&gt; 'admin'\n]);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-18\">\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>\u30e1\u30e2\u30ea\u52b9\u7387\u3092\u6539\u5584\u3059\u308b\u305f\u3081\u306e\u5b9f\u88c5\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass MemoryOptimizer {\n    private $redis;\n    private const MAX_KEY_LENGTH = 100;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u30e1\u30e2\u30ea\u52b9\u7387\u306e\u826f\u3044\u30ad\u30fc\u8a2d\u8a08\n     *\/\n    public function optimizeKeyFormat(string $key): string {\n        \/\/ \u30ad\u30fc\u306e\u9577\u3055\u3092\u5236\u9650\n        if (strlen($key) &gt; self::MAX_KEY_LENGTH) {\n            \/\/ \u30cf\u30c3\u30b7\u30e5\u5316\u3057\u3066\u77ed\u7e2e\n            $key = substr(md5($key), 0, 8) . ':' . \n                   substr($key, -20);\n        }\n\n        return $key;\n    }\n\n    \/**\n     * \u6709\u52b9\u671f\u9650\u306e\u6700\u9069\u5316\n     *\/\n    public function setOptimizedExpiry(string $key, $value, int $ttl): bool {\n        \/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u306eTTL\u3092\u8a2d\u5b9a\n        if ($ttl &lt;= 0) {\n            $ttl = 3600; \/\/ 1\u6642\u9593\n        }\n\n        return $this-&gt;redis-&gt;setex(\n            $this-&gt;optimizeKeyFormat($key),\n            $ttl,\n            $value\n        );\n    }\n\n    \/**\n     * \u30d0\u30c3\u30c1\u51e6\u7406\u3067\u306e\u6700\u9069\u5316\n     *\/\n    public function batchOptimizedOperation(array $operations): array {\n        $pipe = $this-&gt;redis-&gt;multi(Redis::PIPELINE);\n        $optimizedOps = [];\n\n        foreach ($operations as $op) {\n            $optimizedKey = $this-&gt;optimizeKeyFormat($op['key']);\n            $pipe-&gt;$op['command']($optimizedKey, $op['value']);\n            $optimizedOps[] = $optimizedKey;\n        }\n\n        $pipe-&gt;exec();\n        return $optimizedOps;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-19\">\u5b9f\u884c\u6642\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u65b9\u6cd5<\/h3>\n\n\n\n<p>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u306e\u5b9f\u88c5\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisPerformanceMonitor {\n    private $redis;\n    private const MONITOR_KEY_PREFIX = 'monitor:';\n    private const SLOW_OPERATION_THRESHOLD = 100; \/\/ \u30df\u30ea\u79d2\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u64cd\u4f5c\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8a08\u6e2c\n     *\/\n    public function measureOperation(string $operation, callable $callback): array {\n        $startTime = microtime(true);\n        $startMemory = memory_get_usage();\n\n        try {\n            $result = $callback();\n\n            $endTime = microtime(true);\n            $endMemory = memory_get_usage();\n\n            $metrics = [\n                'operation' =&gt; $operation,\n                'duration_ms' =&gt; ($endTime - $startTime) * 1000,\n                'memory_usage' =&gt; $endMemory - $startMemory,\n                'success' =&gt; true\n            ];\n\n            \/\/ \u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u306e\u691c\u51fa\n            if ($metrics['duration_ms'] &gt; self::SLOW_OPERATION_THRESHOLD) {\n                $this-&gt;logSlowOperation($metrics);\n            }\n\n            return [\n                'result' =&gt; $result,\n                'metrics' =&gt; $metrics\n            ];\n        } catch (Exception $e) {\n            $metrics = [\n                'operation' =&gt; $operation,\n                'error' =&gt; $e-&gt;getMessage(),\n                'success' =&gt; false\n            ];\n\n            $this-&gt;logError($metrics);\n            throw $e;\n        }\n    }\n\n    \/**\n     * \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u7d71\u8a08\u306e\u53ce\u96c6\n     *\/\n    private function collectStats(array $metrics): void {\n        $key = self::MONITOR_KEY_PREFIX . date('Y-m-d:H');\n\n        $this-&gt;redis-&gt;hIncrBy($key, 'total_ops', 1);\n        $this-&gt;redis-&gt;hIncrBy($key, 'total_duration', \n                             (int)$metrics['duration_ms']);\n\n        if ($metrics['duration_ms'] &gt; self::SLOW_OPERATION_THRESHOLD) {\n            $this-&gt;redis-&gt;hIncrBy($key, 'slow_ops', 1);\n        }\n\n        \/\/ 24\u6642\u9593\u5f8c\u306b\u81ea\u52d5\u524a\u9664\n        $this-&gt;redis-&gt;expire($key, 86400);\n    }\n\n    \/**\n     * \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30ec\u30dd\u30fc\u30c8\u306e\u751f\u6210\n     *\/\n    public function generateReport(string $date): array {\n        $pattern = self::MONITOR_KEY_PREFIX . $date . ':*';\n        $keys = $this-&gt;redis-&gt;keys($pattern);\n\n        $report = [\n            'total_operations' =&gt; 0,\n            'avg_duration' =&gt; 0,\n            'slow_operations' =&gt; 0,\n            'hourly_stats' =&gt; []\n        ];\n\n        foreach ($keys as $key) {\n            $stats = $this-&gt;redis-&gt;hGetAll($key);\n            $hour = substr($key, -2);\n\n            $report['hourly_stats'][$hour] = [\n                'total_ops' =&gt; (int)($stats['total_ops'] ?? 0),\n                'avg_duration' =&gt; $stats['total_ops'] ? \n                    $stats['total_duration'] \/ $stats['total_ops'] : 0,\n                'slow_ops' =&gt; (int)($stats['slow_ops'] ?? 0)\n            ];\n\n            $report['total_operations'] += $report['hourly_stats'][$hour]['total_ops'];\n            $report['slow_operations'] += $report['hourly_stats'][$hour]['slow_ops'];\n        }\n\n        if ($report['total_operations'] &gt; 0) {\n            $report['avg_duration'] = array_sum(\n                array_column($report['hourly_stats'], 'avg_duration')\n            ) \/ count($report['hourly_stats']);\n        }\n\n        return $report;\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\n$monitor = new RedisPerformanceMonitor($redis);\n\n\/\/ \u64cd\u4f5c\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8a08\u6e2c\n$result = $monitor-&gt;measureOperation('find_users', function() use ($redis) {\n    return $redis-&gt;keys('user:*');\n});\n\n\/\/ \u65e5\u6b21\u30ec\u30dd\u30fc\u30c8\u306e\u751f\u6210\n$report = $monitor-&gt;generateReport(date('Y-m-d'));<\/pre>\n\n\n\n<p>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316\u306e\u30dd\u30a4\u30f3\u30c8\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30ad\u30fc\u8a2d\u8a08\u306e\u6700\u9069\u5316<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7c21\u6f54\u3067\u610f\u5473\u306e\u3042\u308b\u547d\u540d<\/li>\n\n\n\n<li>\u9069\u5207\u306a\u968e\u5c64\u69cb\u9020<\/li>\n\n\n\n<li>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u52b9\u679c\u7684\u306a\u6d3b\u7528<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30e1\u30e2\u30ea\u7ba1\u7406<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30ad\u30fc\u9577\u306e\u5236\u9650<\/li>\n\n\n\n<li>\u9069\u5207\u306aTTL\u306e\u8a2d\u5b9a<\/li>\n\n\n\n<li>\u30d0\u30c3\u30c1\u51e6\u7406\u306e\u6d3b\u7528<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u3068\u5206\u6790<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30e1\u30c8\u30ea\u30af\u30b9\u306e\u53ce\u96c6<\/li>\n\n\n\n<li>\u30b9\u30ed\u30fc\u30af\u30a8\u30ea\u306e\u691c\u51fa<\/li>\n\n\n\n<li>\u5b9a\u671f\u7684\u306a\u30ec\u30dd\u30fc\u30c8\u751f\u6210<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u6700\u9069\u5316\u30c6\u30af\u30cb\u30c3\u30af\u3092\u9069\u5207\u306b\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001Redis\u306e\u6027\u80fd\u3092\u6700\u5927\u9650\u306b\u5f15\u304d\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-20\">\u767a\u5c55\u7684\u306aRedis\u30ad\u30fc\u7ba1\u7406\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n\n\n\n<p>\u3088\u308a\u9ad8\u5ea6\u306aRedis\u306e\u6d3b\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001\u5b9f\u8df5\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u3068\u5b9f\u88c5\u4f8b\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-21\">Redis\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3067\u306e\u30ad\u30fc\u64cd\u4f5c<\/h3>\n\n\n\n<p>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3057\u305f\u5b89\u5168\u306a\u30ad\u30fc\u64cd\u4f5c\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisTransactionManager {\n    private $redis;\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u305f\u8907\u6570\u30ad\u30fc\u306e\u4e00\u62ec\u66f4\u65b0\n     * @param array $keyUpdates \u66f4\u65b0\u3059\u308b\u30ad\u30fc\u3068\u5024\u306e\u914d\u5217\n     * @return bool \u66f4\u65b0\u306e\u6210\u529f\/\u5931\u6557\n     *\/\n    public function atomicKeyUpdate(array $keyUpdates): bool {\n        try {\n            \/\/ \u76e3\u8996\u5bfe\u8c61\u306e\u30ad\u30fc\u3092\u8a2d\u5b9a\n            $watchKeys = array_column($keyUpdates, 'key');\n            $this-&gt;redis-&gt;watch($watchKeys);\n\n            \/\/ \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u958b\u59cb\n            $tx = $this-&gt;redis-&gt;multi();\n\n            foreach ($keyUpdates as $update) {\n                $tx-&gt;set($update['key'], $update['value']);\n\n                \/\/ TTL\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u6709\u52b9\u671f\u9650\u3092\u8a2d\u5b9a\n                if (isset($update['ttl'])) {\n                    $tx-&gt;expire($update['key'], $update['ttl']);\n                }\n\n                \/\/ \u30bf\u30b0\u306e\u66f4\u65b0\uff08\u5fc5\u8981\u306a\u5834\u5408\uff09\n                if (isset($update['tags'])) {\n                    foreach ($update['tags'] as $tag) {\n                        $tx-&gt;sAdd(\"tag:{$tag}\", $update['key']);\n                    }\n                }\n            }\n\n            \/\/ \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30b3\u30df\u30c3\u30c8\n            $results = $tx-&gt;exec();\n            return $results !== false;\n\n        } catch (RedisException $e) {\n            error_log(\"Transaction failed: \" . $e-&gt;getMessage());\n            return false;\n        }\n    }\n\n    \/**\n     * \u30ad\u30fc\u306e\u5024\u3092\u5b89\u5168\u306b\u66f4\u65b0\u3059\u308b\u305f\u3081\u306e\u697d\u89b3\u7684\u30ed\u30c3\u30af\u5b9f\u88c5\n     *\/\n    public function optimisticUpdate(\n        string $key,\n        callable $updateCallback,\n        int $maxRetries = 3\n    ): bool {\n        $attempts = 0;\n        $success = false;\n\n        do {\n            try {\n                $this-&gt;redis-&gt;watch($key);\n                $currentValue = $this-&gt;redis-&gt;get($key);\n\n                \/\/ \u5024\u306e\u66f4\u65b0\u51e6\u7406\n                $newValue = $updateCallback($currentValue);\n\n                \/\/ \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3067\u306e\u66f4\u65b0\n                $tx = $this-&gt;redis-&gt;multi();\n                $tx-&gt;set($key, $newValue);\n                $results = $tx-&gt;exec();\n\n                $success = ($results !== false);\n\n            } catch (RedisException $e) {\n                error_log(\"Update attempt failed: \" . $e-&gt;getMessage());\n                $success = false;\n            }\n\n            if (!$success) {\n                $attempts++;\n                \/\/ \u6307\u6570\u30d0\u30c3\u30af\u30aa\u30d5\u306b\u3088\u308b\u5f85\u6a5f\n                usleep(min(100000 * pow(2, $attempts), 1000000));\n            }\n\n        } while (!$success &amp;&amp; $attempts &lt; $maxRetries);\n\n        return $success;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-22\">Redis\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3067\u306e\u30ad\u30fc\u5206\u6563\u6226\u7565<\/h3>\n\n\n\n<p>\u30af\u30e9\u30b9\u30bf\u74b0\u5883\u3067\u306e\u52b9\u7387\u7684\u306a\u30ad\u30fc\u7ba1\u7406\u3092\u5b9f\u73fe\u3059\u308b\u5b9f\u88c5\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisClusterKeyManager {\n    private $cluster;\n\n    public function __construct(RedisCluster $cluster) {\n        $this-&gt;cluster = $cluster;\n    }\n\n    \/**\n     * \u30af\u30e9\u30b9\u30bf\u74b0\u5883\u306b\u6700\u9069\u5316\u3055\u308c\u305f\u30ad\u30fc\u8a2d\u8a08\n     *\/\n    public function createClusterOptimizedKey(\n        string $entityType,\n        string $entityId,\n        array $metadata = []\n    ): string {\n        \/\/ \u30cf\u30c3\u30b7\u30e5\u30bf\u30b0\u3092\u4f7f\u7528\u3057\u3066\u95a2\u9023\u30ad\u30fc\u3092\u540c\u4e00\u30b9\u30ed\u30c3\u30c8\u306b\u914d\u7f6e\n        $hashTag = substr(md5($entityId), 0, 8);\n        $key = sprintf('{%s}:%s:%s', $hashTag, $entityType, $entityId);\n\n        if (!empty($metadata)) {\n            $key .= ':' . implode(':', array_map(\n                fn($k, $v) =&gt; $k . '-' . $v,\n                array_keys($metadata),\n                array_values($metadata)\n            ));\n        }\n\n        return $key;\n    }\n\n    \/**\n     * \u95a2\u9023\u30c7\u30fc\u30bf\u306e\u5206\u6563\u4fdd\u5b58\n     *\/\n    public function distributeRelatedData(\n        string $entityType,\n        string $entityId,\n        array $data\n    ): array {\n        $results = [];\n        $baseKey = $this-&gt;createClusterOptimizedKey($entityType, $entityId);\n\n        try {\n            \/\/ \u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u305f\u4e00\u62ec\u51e6\u7406\n            $pipe = $this-&gt;cluster-&gt;pipeline();\n\n            foreach ($data as $key =&gt; $value) {\n                $distributedKey = sprintf('%s:%s', $baseKey, $key);\n                $pipe-&gt;set($distributedKey, $value);\n\n                \/\/ \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u66f4\u65b0\n                $indexKey = sprintf('index:%s:%s', $entityType, $key);\n                $pipe-&gt;sAdd($indexKey, $distributedKey);\n            }\n\n            $results = $pipe-&gt;exec();\n\n        } catch (RedisClusterException $e) {\n            error_log(\"Cluster distribution failed: \" . $e-&gt;getMessage());\n        }\n\n        return $results;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-23\">\u76e3\u8996\u3068\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u306e\u81ea\u52d5\u5316\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p>\u30b7\u30b9\u30c6\u30e0\u306e\u5065\u5168\u6027\u3092\u7dad\u6301\u3059\u308b\u305f\u3081\u306e\u81ea\u52d5\u5316\u30c4\u30fc\u30eb\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\nclass RedisMaintenanceAutomation {\n    private $redis;\n    private const MAINTENANCE_PREFIX = 'maintenance:';\n    private const ALERT_THRESHOLD = 1000; \/\/ \u30ad\u30fc\u6570\u306e\u8b66\u544a\u3057\u304d\u3044\u5024\n\n    public function __construct(Redis $redis) {\n        $this-&gt;redis = $redis;\n    }\n\n    \/**\n     * \u5b9a\u671f\u7684\u306a\u30ad\u30fc\u5206\u6790\u3068\u6e05\u6383\n     *\/\n    public function analyzeAndCleanup(string $pattern): array {\n        $stats = [\n            'analyzed' =&gt; 0,\n            'expired' =&gt; 0,\n            'cleaned' =&gt; 0,\n            'warnings' =&gt; []\n        ];\n\n        try {\n            $iterator = null;\n            do {\n                $keys = $this-&gt;redis-&gt;scan($iterator, [\n                    'match' =&gt; $pattern,\n                    'count' =&gt; 100\n                ]);\n\n                if ($keys === false) {\n                    break;\n                }\n\n                foreach ($keys as $key) {\n                    $stats['analyzed']++;\n\n                    \/\/ TTL\u306e\u78ba\u8a8d\n                    $ttl = $this-&gt;redis-&gt;ttl($key);\n\n                    if ($ttl &lt; 0) {\n                        \/\/ \u671f\u9650\u5207\u308c\u307e\u305f\u306fTTL\u672a\u8a2d\u5b9a\u306e\u30ad\u30fc\n                        $stats['expired']++;\n\n                        \/\/ \u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u51e6\u7406\n                        if ($this-&gt;shouldCleanup($key)) {\n                            $this-&gt;redis-&gt;del($key);\n                            $stats['cleaned']++;\n                        }\n                    }\n                }\n\n                \/\/ \u8b66\u544a\u6761\u4ef6\u306e\u30c1\u30a7\u30c3\u30af\n                if ($stats['analyzed'] &gt; self::ALERT_THRESHOLD) {\n                    $stats['warnings'][] = sprintf(\n                        'High key count detected: %d keys found',\n                        $stats['analyzed']\n                    );\n                }\n\n            } while ($iterator &gt; 0);\n\n            \/\/ \u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u8a18\u9332\u306e\u66f4\u65b0\n            $this-&gt;updateMaintenanceLog($stats);\n\n        } catch (RedisException $e) {\n            error_log(\"Maintenance failed: \" . $e-&gt;getMessage());\n            $stats['errors'] = [$e-&gt;getMessage()];\n        }\n\n        return $stats;\n    }\n\n    \/**\n     * \u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u30ed\u30b0\u306e\u7ba1\u7406\n     *\/\n    private function updateMaintenanceLog(array $stats): void {\n        $logKey = self::MAINTENANCE_PREFIX . date('Y-m-d:H');\n\n        $this-&gt;redis-&gt;hMSet($logKey, [\n            'timestamp' =&gt; time(),\n            'analyzed' =&gt; $stats['analyzed'],\n            'cleaned' =&gt; $stats['cleaned'],\n            'warnings' =&gt; json_encode($stats['warnings'])\n        ]);\n\n        \/\/ \u30ed\u30b0\u306e\u4fdd\u6301\u671f\u9593\u3092\u8a2d\u5b9a\n        $this-&gt;redis-&gt;expire($logKey, 86400 * 7); \/\/ 7\u65e5\u9593\u4fdd\u6301\n    }\n\n    \/**\n     * \u30ad\u30fc\u306e\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u5224\u5b9a\n     *\/\n    private function shouldCleanup(string $key): bool {\n        \/\/ \u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u30dd\u30ea\u30b7\u30fc\u306e\u5b9f\u88c5\n        $patterns = [\n            'temp:*' =&gt; true,      \/\/ \u4e00\u6642\u7684\u306a\u30ad\u30fc\n            'cache:*' =&gt; true,     \/\/ \u30ad\u30e3\u30c3\u30b7\u30e5\u30ad\u30fc\n            'session:*' =&gt; true,   \/\/ \u671f\u9650\u5207\u308c\u30bb\u30c3\u30b7\u30e7\u30f3\n            'permanent:*' =&gt; false  \/\/ \u6c38\u7d9a\u7684\u306a\u30ad\u30fc\n        ];\n\n        foreach ($patterns as $pattern =&gt; $should) {\n            if (fnmatch($pattern, $key)) {\n                return $should;\n            }\n        }\n\n        return false; \/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u3057\u306a\u3044\n    }\n}<\/pre>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u767a\u5c55\u7684\u306a\u30c6\u30af\u30cb\u30c3\u30af\u306e\u30dd\u30a4\u30f3\u30c8\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7ba1\u7406<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u697d\u89b3\u7684\u30ed\u30c3\u30af\u306e\u9069\u5207\u306a\u4f7f\u7528<\/li>\n\n\n\n<li>\u30ea\u30c8\u30e9\u30a4\u6226\u7565\u306e\u5b9f\u88c5<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5fb9\u5e95<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30af\u30e9\u30b9\u30bf\u5bfe\u5fdc\u306e\u8a2d\u8a08<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30cf\u30c3\u30b7\u30e5\u30bf\u30b0\u306b\u3088\u308b\u30ad\u30fc\u306e\u914d\u7f6e\u5236\u5fa1<\/li>\n\n\n\n<li>\u95a2\u9023\u30c7\u30fc\u30bf\u306e\u52b9\u7387\u7684\u306a\u5206\u6563<\/li>\n\n\n\n<li>\u30af\u30e9\u30b9\u30bf\u7279\u6709\u306e\u5236\u7d04\u3078\u306e\u5bfe\u5fdc<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u81ea\u52d5\u5316\u3068\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b9a\u671f\u7684\u306a\u5065\u5168\u6027\u30c1\u30a7\u30c3\u30af<\/li>\n\n\n\n<li>\u30a4\u30f3\u30c6\u30ea\u30b8\u30a7\u30f3\u30c8\u306a\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7<\/li>\n\n\n\n<li>\u8a73\u7d30\u306a\u30ed\u30b0\u8a18\u9332\u3068\u76e3\u8996<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u9069\u5207\u306b\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u3001\u5927\u898f\u6a21\u306aRedis\u74b0\u5883\u3067\u3082\u5b89\u5b9a\u3057\u305f\u904b\u7528\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Undefined array key &#8220;is_admin&#8221; in \/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":{"0":"post-3322","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-php","7":"nothumb"},"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3322"}],"version-history":[{"count":2,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3322\/revisions"}],"predecessor-version":[{"id":3324,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/3322\/revisions\/3324"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}