<IfModule LiteSpeed> RewriteEngine On CacheEngine on esi crawler CacheEnable public / RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ RewriteRule .* - [E=Cache-Control:max-age=3600] </IfModule>
วิธีตรวจสอบ ใช้ลองใช้งาน Debug header ดู แล้วหาค่า “x-litespeed-cache:” จะโชว์ขึ้นมา แสดงว่าโค๊ดเริ่มทำงานแล้ว
จากตัวอย่างด้านบน คือทำการตั้งค่าแคชไว้ที่ 3600 วินาที หรือ 1 ชั่วโมงครับ
The post การใช้ .htaccess เปิดใช้งาน lscache ใน Litespeed first appeared on 1412.]]>กรณีใช้งาน OpenLiteSpeed กับระบบ DirectAdmin ผู้ดูแลระบบที่เจอปัญหาผู้ใช้งานแก้ไข .htaccess แล้วไม่ทำงาน สามารถตั้ง Cronjob เพื่อให้เช็คได้ดังนี้ครับ
*/3 * * * * root if ! find /home/*/domains/*/*_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fi* * root if ! find /home/*/domains/*/*_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then /usr/local/lsws/bin/lswsctrl restart; fiThe post Auto Restart OpenLiteSpeed เมื่อมีการเปลี่ยน Rule ใน .htaccess ใน DirectAdmin first appeared on 1412.]]>
Header ที่ส่งกลับมา
cf-edge-cache: cache,platform=wordpress x-litespeed-cache: hit cf-cache-status: HIT
ลองดูว่าต้องมี 3 ค่านี้ส่งกลับมาที่ Client นะครับ วิธีการเช็ค Header ง่ายๆ ก็ใช้ Command line : curl
curl -Iv https://cloudhost.in.th
สำหรับการทดสอบกับ OpenLiteSpeed จะไม่พ่น cf-edge-cache ออกมาครับ ซึ่งก็คาดว่าจะรองรับเฉพาะเวอร์ชั่น LiteSpeed Enterprise เท่านั้น
สำหรับใครที่อยากจะเซตแบบนี้ CloudHost.in.th มีบริการเซตให้ฟรี รองรับ 1 Domain เท่านั้น ดูบริการ Cloud Server สำหรับ WordPress Hosting ได้ที่ลิงก์ด้านล่างนี้
cd /usr/local/directadmin/custombuild echo "openlitespeed:1.6.13:a944b069ac70c3e574c25def6e1d6b2f" > custom_versions.txt ./build openlitespeed
Update: แก้ไขเวอร์ชั่น 1.7.6 ได้ทำการแก้ไข Bug HTTP/3 เรียบร้อยแล้ว
The post แก้ไขปัญหา OpenLiteSpeed ไม่รองรับ HTTP3/QUIC first appeared on 1412.]]>