XenForo LiteSpeed Cache 1.1.0

Владимир Миронов

Проверенные
Сообщения
1,001
Реакции
770
Баллы
8,295
Выложите пжл. плагин XenForo LiteSpeed Cache 1.1.0


Вроде как плагин для кеширования, но надо проверять на сколько он хорошо это делает.
Он совместим с XF 1.2
 
Compatible XF Versions: 1.2
Additional Requirements: Requires LiteSpeed Enterprise Web Server 2 CPU license or higher -
Even on the busiest of forums, the majority of queries and server load often come from guest users browsing the forum. This can be even more evident if you have sudden flash visits to your site following some sort of promotion or event.

This addon works in conjunction with LiteSpeed's Enterprise Web Server to leverage the caching mechanism in LiteSpeed to create a 60 second rolling window of all pages accessed on your site for guest users.

This includes most notably:

The Forum Homepage (/index)
Node pages (/forums)
Threads (/threads)
Thread Pages (/threads/page-2 etc)
Member profiles (/members)

Whenever a page is first loaded, its output is saved in the cache, and all subsequent guest visits to this page within the 60 second window are served from the cache, rather than by generating a new page load (and thus the queries are eliminated). After 60 seconds, the cached file is removed, and the process repeats. This allows for an active forum to maintain a very active appearance to guests, even though the page they are viewing could be upto 59 seconds old.

Importantly, logged in users are not subject to this caching, and the forum will work normally for logged in users!

This is a small 5 minute test run on a very active (3000 online users) forum with approximately half of its users being guests. The 2 black lines represent when the addon was enabled and then disabled.

test.png



Installation


1) Install the addon (Note, this will log all your users out, this is intended and required)

2) Run the following commands in SSH
Код:
mkdir /tmp/diskcache
chown nobody:nobody /tmp/diskcache
chmod 777 /tmp/diskcache


3) In LiteSpeed set your cache policies, this can be done per-vhost or on a server-wide level.
Код:
Storage Path: /tmp/diskcache
Max Object Size: 1024000
Enable Cache: No (this is correct, we will use .htaccess later to override this)
Cache Expire Time: 120
Cache Request with Query String: Yes
Cache Request with Cookie: Yes
Cache Response with Cookie: Yes
Ignore Request Cache-Control: Yes
Ignore Response Cache-Control: Yes
Enable Private Cache: Not Set
Private Cache Expire Time: Not Set


4) Add the following to the top of your .htaccess (if you have .htaccess import redirects, place these *after* the redirects)
Код:
<IfModule litespeed>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !skipPageCache
RewriteRule .* - [E=Cache-Control:max-age=60]
</IfModule>


5) Optionally, add a clean up cron job to remove old cached files more than 2 minutes old.
Код:
*/10 * * * * root find /tmp/diskcache -type f -mmin +2 -delete 2>/dev/null


Important
To disable this addon, you *must* remove or comment out the .htaccess rewrites also. Disabling the addon in ACP will only cause other issues.
 

Вложения

  • Litespeedcache_1.1.0.zip
    1.9 KB · Просмотры: 9
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу