

Redis เป็น software ที่ทำงานบน server ที่จะคอยเก็บค่าข้อมูลแบบ in-memory data structure store ไว้ใน RAM เพื่อรอเรียกใช้งาน (หลักการทำงานคล้าย database) ด้วยจุดเด่นนี้จึงทำให้ Redis สามารถ read, write, update หรือ delete ข้อมูลได้เร็วมาก (นิยมใช้ในการเก็บข้อมูลแบบ temporary file หรือ cache กัน เพื่อให้เรียกใช้งานได้รวดเร็ว)
ด้วยความพิเศษนี้จึงมีการนำ Redis มาประยุกต์ใช้กับ server ที่เราให้บริการเพื่อให้ WordPress ทำงานรวดเร็วมากยิ่งขึ้นด้วยการลด query และการเรียกข้อมูลที่ซ้ำซ้อนหลายๆ ครั้ง โดยข้อมูลพวกนี้จะถูก Redis เก็บไว้ใน RAM และเรียกใช้งานได้เลยทันที ไม่ต้องประมวลผลจากปลั๊กอินและดึงข้อมูลจาก database อีก โดยสามารถเปิดใช้งานได้ผ่านปลั๊กอิน Redis Object Cache ตาม ขั้นตอนต่อไปนี้
ก่อนที่จะติดตั้งปลั๊กอินให้ใส่ค่านี้ลงไปในไฟล์ wp-config.php ผ่าน control panel ที่ใช้งานก่อน โดยให้เปลี่ยน ‘example’ เป็นค่า Cache Key โดยใส่เป็นตัวเลขหรืออักษรสุ่ม
define( 'WP_CACHE_KEY_SALT', 'example' );
define( 'WP_REDIS_SELECTIVE_FLUSH', true);
ตัวอย่างเช่น
define( 'WP_CACHE_KEY_SALT', '78951sdwufjryagfr9a1247sdrbjdyangh1' );
define( 'WP_REDIS_SELECTIVE_FLUSH', true);
ลงชื่อเข้าใช้งาน WordPress ที่ต้องการติดตั้งปลั๊กอิน Redis Object Cache

ติดตั้งและเปิดใช้งานปลั๊กอิน Redis Object Cache

คลิกที่ Settings

คลิกที่ Redis

คลิกที่ Enable Object Cache

ระบบจะเปิดใช้งาน Redis ดังภาพตัวอย่าง

นอกจากนี้ปลั๊กอิน Redis Object Cache ยังสามารถทำงานควบคู่กับปลั๊กอิน cache ชื่อดังตัวอื่นๆ
เพื่อให้ได้ประสิทธิภาพและความเร็วที่มากขึ้นได้อีกด้วย เช่น WP Rocket, WP Fastest Cache,
W3 Total Cache หรือ WP Super Cache (แนะนำให้ติดตั้งคู่กับ WP Super Cache เพราะดีและฟรี)