Jump to content
View in the app

A better way to browse. Learn more.

PHP论坛人

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Invision Community論壇啟用Redis加速

Featured Replies

Invision Community論壇啟用 Redis 加速

為什麼論壇需要 Redis?

提升讀取速度:記憶體存取比硬碟快數十倍,顯著提升頁面加載速度 。

減輕資料庫壓力:大幅降低 MySQL 的查詢負載,讓資料庫在高負載時仍能穩定運作 。

改善使用者體驗:減少瀏覽延遲,特別是在高併發存取時能維持流暢度 。

檢查論壇是否啟用Redis

論壇後端 -> 系統 -> 獲得支援 -> 快取引擎:None (表示未啟用Redis)

01.png

設置Redis加速

論壇後端 -> 系統 -> 進階配置 -> 資料儲存 ->

預設情況是

02.png

如果在安裝LNMP過程中,有確實安裝Redis,就能選擇

資料儲存方式 -> Redis

快取方式 -> Redis

IPS論壇有兩個地方可啟用Redis,在此由自己的VPS硬體配置決定開啟或關掉誰

Redis server address -> 127.0.0.1

Redis port number -> 6379

使用Redis來減少MySQL Overhead -> v 是

Redis將用於會話、管理主題瀏覽數

-> 儲存

03.png

接下來,出現選項 [下載 constants.php],按下按鈕,下載constants.php這個檔案

再使用SFTP將constants.php上傳到IPS論壇的根目錄

04.png

為什麼需要 constants.php?

論壇會透過此檔案定義Redis連線與快取設定

若檔案不存在,Redis將不會生效

當SFTP上傳 constants.php 這個檔案後,回到瀏覽器,按下 [繼續]

接下來,SSH登入

修正檔案擁有者與權限,設為 www-data (避免Nginx/PHP 使用者無法讀寫)

chown www-data:www-data /var/www/域名.com/constants.php

cd /var/www/域名.com

確認輸出顯示為 www-data www-data

ls -l

回到瀏覽器,論壇後端 -> 系統 -> 獲得支援 ->

可以看到 快取引擎:Redis

表示論壇已啟用Redis

05.png

Edited by Jack

Create an account or sign in to comment

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.