this post was submitted on 14 Jun 2023
6 points (100.0% liked)

Announcements

8 readers
1 users here now

Announcements/Changelogs go here.

founded 2 years ago
MODERATORS
 

I've been using a caching solution in hopes that down the line it will take some load off my server for when we grow bigger.

Evidently it's been serving up stale copies of pages so I've since stopped using it. This issue shouldn't happen anymore.

top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 2 years ago (1 children)

Would love to hear more about what you have in mind for caching a Lemmy instance.

[–] [email protected] 2 points 2 years ago (1 children)

Without going into specifics, I've been using haproxy to cache the backend to make it so that the server box and the software it's running on do less work. I've actually been using it before I setup this instance too but this was before I started getting a lot of traffic for something I selfhosted.

My other services (piped, invidious, libreddit, etc) barely ever got used so I guess I never got a chance to fully test it completely.

[–] [email protected] 2 points 2 years ago (1 children)

This would explain the rare cases of posts having an entirely different comments.

I've used NGINX for load balancing and caching, but none of my projects have ever gotten this large. Dynamic content like Lemmy responses shouldn't be cached as data is unique for every user. Static content like imgs, vids, ext; would be improved by caching. I suggest caching the /pictrs/image/ route, should make large images load faster.

For caching Lemmy data, I'd suggest Redis, but idk if Lemmy currently supports it.

[–] [email protected] 4 points 2 years ago* (last edited 2 years ago) (1 children)

Yeah, for some reason I thought haproxy had its own way of dealing with dynamic content. I didn't seem to have any problems perusing my selfhosted stuff that doesn't get much traffic, so I just assumed that that was the case.

Currently I use Caddy, and its caching module is more designed for distributed caching so I've been having Caddy proxy requests to haproxy within the same docker network and having haproxy proxy all requests to my box here from the VPS that both Caddy and haproxy are on.

The big reason I don't just use nginx is because Caddy has support for http/3 whereas for nginx, it's still being developed. I'm not sure if that makes a huge difference but it sure sounds that way since http/3 uses UDP and not TCP, meaning handshakes aren't a thing.

AFAIK Lemmy doesn't have support for Redis, otherwise I would've jumped on that the second I found out about it.

[–] [email protected] 3 points 2 years ago (1 children)

That being said, I'll look at the docs more and see on how to cache just the /pictrs/image endpoint.

[–] [email protected] 1 points 2 years ago

Went with Varnish instead of haproxy since haproxy can only do caching in-memory. And images are only being cached now.

load more comments
view more: next ›