Using DigitalOcean Spaces or Amazon S3 for file storage in XF 2.1+

Using DigitalOcean Spaces or Amazon S3 for file storage in XF 2.1+

No permission to download

Chromaniac

Well-known member
one thing though. i am getting cf-cache-status: DYNAMIC. i guess would need to use a pagerule to switch it to hit. (attachments are open to guests)
 

MattW

Well-known member
one thing though. i am getting cf-cache-status: DYNAMIC. i guess would need to use a pagerule to switch it to hit. (attachments are open to guests)
I have a page rule in place telling them to cache everything after /attachments/

1663956781172.png
 

Chromaniac

Well-known member
right. i was getting confused with cache control for which i use the free xenforo addon. that correctly appears as public on my board.
i am guessing cache-status does not really matter here 😋 because the file is already hosted on cloudflare and they do the location optimization automatically.
 

MattW

Well-known member
right. i was getting confused with cache control for which i use the free xenforo addon. that correctly appears as public on my board.
i am guessing cache-status does not really matter here 😋 because the file is already hosted on cloudflare and they do the location optimization automatically.
Adding the page rule to cache everything allows the bypass of the file permissions through XF and PHP, so it prevents the file being streamed from the bucket, and served directly from Cloudflare cache on the edge nodes

Pasting the full URL from z22se of an image in a node which requires a user to be logged in will still show the full image. One on my other site, asks you to log in, because the XF image permissions are still being respected.
 

Sprisa

Member
About this guide, is it possible to instead of AWS or Digitalocean, to use the server you're currently on with a subdomain, like cdn.youdomain.net
 

Chromaniac

Well-known member
1664546627228.png

This is for a week for a low traffic website with only a few members allowed to upload attachments lol. Code Cache and Temp folders are on host server and not R2. Not sure what I am doing wrong lol.

Class A Operations 1 million requests / month
Class B Operations 10 million requests / month

I suppose I would remain in free tier in any case. But still... 👀
 

MattW

Well-known member
1664546883422.png

16GB of attachments for this site. The large spike in Class B is me doing an initial rclone backup down to my storage server.
 

Chromaniac

Well-known member
I can only imagine oembed data folder because I kept a very short cache of it. Increased it to a higher limit. I expect the graph to calm down now 😬.
 

Chromaniac

Well-known member
Yes. Any S3 compatible service should work like backblaze b2, Wasabi etc. At least two of us are using Cloudflare r2 with some code changes.
 

Chromaniac

Well-known member
mmm nope. you are confusing cloud storage with object storage.

you do not need this addon if you have enough storage on your core hosting plan. there is another product that seems like something you are looking for. it's called block storage. both object and block storage requires specific implementation from the hosting company. block storage is usually used on the same host you are hosting your site on. object storage can be a third party service like amazon or backblaze.
 

Chromaniac

Well-known member
B2 also has 10GB free so that's also an option if you are still under 10GB storage space.

R2 makes a lot of sense if you are already using Cloudflare for DNS and performance benefits as it handles location of data storage automatically.



On my install... I disabled oembed cache and noticed that A/B transactions fell down significantly. Not sure if it makes sense to file a feature request for a config.php option to change location of the oembed cache folder. If it is made available, it would be nice considering this data is always going to be fetched from object storage and would reduce transactions for pretty much every user?

If one of the advance user of this addon thinks that it makes sense, please post a feature request for the same. Cheers!
 

Moshe1010

Well-known member
B2 also has 10GB free so that's also an option if you are still under 10GB storage space.

R2 makes a lot of sense if you are already using Cloudflare for DNS and performance benefits as it handles location of data storage automatically.



On my install... I disabled oembed cache and noticed that A/B transactions fell down significantly. Not sure if it makes sense to file a feature request for a config.php option to change location of the oembed cache folder. If it is made available, it would be nice considering this data is always going to be fetched from object storage and would reduce transactions for pretty much every user?

If one of the advance user of this addon thinks that it makes sense, please post a feature request for the same. Cheers!
The main problem with R2 that it's private by default, so except using cloudflare image optimization, I guess there are not many options to optimize data upon upload (mainly images). Image compression can save 30-50% of the image size without effecting quality that much, so I'm wondering how is it possible to enjoy both worlds.
 

Chromaniac

Well-known member
i am using an addon that compress images at the time of upload and that file gets uploaded to r2.

i am guessing image optimization addons available here that resize existing attachments would also work fine though would boost transactions and bandwidth initially.

i am not sure if Cloudflare Mirage or Polish would work on Xenforo Attachments though.
 

Moshe1010

Well-known member
i am using an addon that compress images at the time of upload and that file gets uploaded to r2.

i am guessing image optimization addons available here that resize existing attachments would also work fine though would boost transactions and bandwidth initially.

i am not sure if Cloudflare Mirage or Polish would work on Xenforo Attachments though.
Which add-on?
 
Top