/gen/

(5 KB, 188x256, t_e38468f9b7ed0d663c7088f547f75e74fd4294f03ee6152da16f4c8afb246708.jpg) (67 KB, 188x256, t_e38468f9b7ed0d663c7088f547f75e74fd4294f03ee6152da16f4c8afb246708.png)
It's a shame that so often while browsing BBWChan I scroll and images fail to load. While recognizing that server resources are of course limited by $$$ as a dev myself I wanted to poke around and see if there was anything maybe that could be enhanced/improved to fix things and maybe even save some moolah.

I noticed that some thumbnails are actually being generated as PNG files, which I assume is because the full-size image was a PNG. However, serving thumbnails as PNGs can be extremely wasteful. For example, from https://bbw-chan.nl/ssbbw/res/30909.html , here's the PNG thumbnail it currently has vs a JPG I made from that thumbnail at 50% quality (optimized, non-progressive).

I think you'll find that you can't see any difference whatsoever. But there's a definitely a difference in terms of server traffic, because the JPG is only 5.73KB whereas the PNG is 65.5KB. That's more than 10 times smaller. 60 KB may not be a lot in real terms, but multiply that by every visitor to the site and it adds up quickly.

I don't know too much about this board software but is there not some kind of setting to force all thumbnails to be generated as JPG regardless of how they're uploaded? There's quite a lot of PNGs on the art boards like /bbwdraw/ and /bbfurries/ where JPGs are often disdained by artists. There's several PNGs on the first page of /bbwdraw/ already and at least a few on page 1 of /ssbbw/ too.

I also note that the cache time for images is really, really short. The site currently sends images with a cache expiry time of 24 hours. But actually the images really should just never expire, since they all have unique IDs and never change. For regular visitors to the site, a longer cache time might mean their browsers don't try to retrieve images they've already grabbed. Of course, images from bbw-chan may not exactly have high priority and will ultimately get evicted from the cache, but there's literally no harm in specifying a longer expiry time, and it could save bandwidth. I'm not sure if this is a property of the board or of the nginx server serving the board, but a simple nginx configuration would make it set the "Expires" header to the maximum value in the future for everything matching https://bbw-chan.nl/.media/ (which is the root directory from which all the media seems to be accessed). See http://nginx.org/en/docs/http/ngx_http_headers_module.html for details.

Finally, since the site seems to struggle so much I wonder if it would be worth reducing the maximum number of images per post. After all, less images per post -> less thumbnails visible while scrolling through pages -> less requests and bandwidth.
Would someone please look into this? Most of the thumbnails and full-sized pics are cutting out. About half the time, just loading a page will cut out.
>>11454 (OP)
Good suggestions. Also, I think the reply box should be made smaller. Sometimes I need to zoom out my browser to reply to posts lol.
>>11458
I was starting to think it was just me. The site only recently started doing this to me; I thought my computer was starting to act up.
Not much I can do about all thumbs being generated as JPGs, as that's a part of the board software that's a little too deep for me.

I did try to implement caching on the /.media/ directory, however we are using a reverse proxy to communicate to the board software so I'm unsure if this is actually working correctly. I did notice that the send_timeout and a few other general nginx settings were somewhat low so I fiddled with those as well.

Let me know if you can tell a difference.
(2 KB, bbw-chan.nl.nginx.ssl.txt) (5 KB, nginx.txt)
Attached is our nginx server-wide .conf and our separate domain conf. Those who are versed in such things, please, have a look and suggest anything that might improve performance and I'll have a listen.
Nevermind I lied, I CAN make all thumbnails be JPG, however, this would mean animated gif thumbs would not animate. Which kinda defeats the purpose of gifs, but yes, overall this would save a fair chunk of bandwidth.
>>11481
Even on major boards like 4chan it's rare for the *thumbnail* to animate, you have to click for full-size in order to see an animation, so I don't see "thumbnails won't animate" as a downside, myself

It looks like you got the browser cache settings for images correct now, I see images now coming back with "cache-control: max-age=31536000" which means web browsers will cache images for up to a year.
>>11480
hey, BarclayCard, what the heck happened? :-/

Back to top