XF 2.2 - Cloudflare - CDN - and Litespeed - best configuration

zeus1971

Collaborate
Collaborate
Registered
Joined
Apr 18, 2020
Messages
310
Points
73

Reputation:

Ok, let see if with my english I can explain me....?‍♂️

Actually my XF 2.2 site is in a share hosting, with an integrated CLOUDFLARE plan (basically as a free normal plan...) BUT with the DNS zone managed directly in the Cpanel of my hosting. And also from Hosting CPANEL I can swtch ON or OFF cloudflare.
And in the DNS of my hosting I see this setting for cloudflare (probably something personalized for partners...) :
A (host) and CNAME www , pointing to a cloudlfare directions.

My hosting is using also litespeed server, so I installed the XF addon litespeed too. (that for what I know works ONLY for guest users, not logged in)
Actually all is working fine.

Now the idea ( thanks @Pr0fesseur ) is to use a CDN (BunnyCDN) overall for images (I use media gallery too), and basically for what I saw, I need to change only the config.php in the SRC folder, with this parameters...
example :
$config['externalDataUrl'] = 'https://examplepull-1a2b.kxcdn.com/data';
$config['javaScriptUrl'] = 'https://examplepull-1a2b.kxcdn.com/js';

At this point my questions are :
1) Do I need to disable (or would be better ) disable clouflare service, to use Bunny CDN ?
2) Do I need to disable litespeed too ? Or serving only static page cached to guests users, I can mantain it ?
3) Do I need change my DNS zone values ?

Thanks !
 

zeus1971

Collaborate
Collaborate
Registered
Joined
Apr 18, 2020
Messages
310
Points
73

Reputation:

I have installed CDN, and it's working. But it's working only for thumbnails ,avatars,....but not for real attached pictures in post or media gallery...:unsure:
The problem seems to be the fancybox (lightbox) function that call a partial path locally ( and not the CDN path)
Probably something else is to setup in the config.php or style/template...., but I don't know what or how...

1599392409077.png
 
Last edited:

zeus1971

Collaborate
Collaborate
Registered
Joined
Apr 18, 2020
Messages
310
Points
73

Reputation:

Reading some posts in the web ,seems that attachment are not cacheble with CDN in xenforo ! Really ???!
Pff...
 

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

At this point my questions are :
1) Do I need to disable (or would be better ) disable clouflare service, to use Bunny CDN ?
No they are different services

https://support.bunnycdn.com/hc/en-us/articles/360001631951-How-to-set-up-BunnyCDN-with-a-custom-hostname-on-CloudFlare


2) Do I need to disable litespeed too ? Or serving only static page cached to guests users, I can mantain it ?
No litespeed is server side cache basically set it up and youre good to go.
https://www.litespeedtech.com/products/cache-plugins/xenforo-acceleration/lscxf-download

3) Do I need change my DNS zone values ? Not if youre using cloudflare, see the first link above.

Use https://xfrocks.com/resources/bd-attachment-store-for-xenforo-2-0.35/ to cache attachmnets

[FEATURES]
1. Store attachments in `data` directory <-----USE THIS TO MOVE ATTACHMENTS TO DATA FOR CDN
2. Store attachments with Amazon S3 (+CloudFront)
3. Store attachments in remote server via FTP
4. Tools to move existing attachments to new storage
5. With option "Keep Local File" for Amazon S3 and FTP, your data is extremely safe and you can disable/uninstall the add-on anytime without absolutely no problems

OR
use the BunnyCDN storage zone for attachments https://support.bunnycdn.com/hc/en-us/articles/115003780169-How-to-upload-and-access-files-from-your-Storage-Zone
 
Last edited:

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

see below
 

zeus1971

Collaborate
Collaborate
Registered
Joined
Apr 18, 2020
Messages
310
Points
73

Reputation:

Ok, thx. But the point is that INTERNAL_DATA where attachment (and media) are for default, are not cacheable.
Probably there is a way, but I'm not confortable to chenge source code or path to standard XF code.
I search the original xenforo threed, with the answer of Chris..., wait...
 

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

you literally glazed over what i sent you... you MOVE attachments to the data directory using Attachment store then the CDN will see them

and it becomes $config['externalDataUrl'] EXTERNAL DATA
 

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

theyre uncachable WITHOUT attachments tore
 

zeus1971

Collaborate
Collaborate
Registered
Joined
Apr 18, 2020
Messages
310
Points
73

Reputation:

Ok , I will try with my XF 2.2 b5 .
But I don't understand what the plugin do... :
1599407338496.png

Of course I need permission for Albums and so on in Media gallery...
 

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

That means you will lose permissions if you use FTP or other offsite applications be ccause permissions are stored in XENFORO and not remotely unless you use S3.

This does not apply when using locally stored files you can ignore
 

zeus1971

Collaborate
Collaborate
Registered
Joined
Apr 18, 2020
Messages
310
Points
73

Reputation:

ok. So if I use Extrnal_data, than it will cache with BUNNY , that is what I want.
Perfect. Thank you @Pr0fesseur
 

zeus1971

Collaborate
Collaborate
Registered
Joined
Apr 18, 2020
Messages
310
Points
73

Reputation:

Hope that this addon is compatible with 2.2 (media gallery too) , and all is new feature, also with cache tools
/admin.php?tools/rebuild
 
Top