eupolicy.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
This Mastodon server is a friendly and respectful discussion space for people working in areas related to EU policy. When you request to create an account, please tell us something about you.

Server stats:

216
active users

#Cache

1 post1 participant0 posts today

I got some feedback about how slow my #blog is to load. I decided to try my hand at setting up an #nginx #cache so that the requests can be satisfied by the cache instead of being generated by the blog software itself.

Just doing a few quick tests myself, it seems the like responses come a bit quicker, but I still think some of the delay is just due to the garbage residential Spectrum service.

If anyone would like to poke at my blog and share any observations on load time and potential cache performance, that'd be cool. :-)
#homelab #selfhost #selfhosting

After I published a recent article where I showed how to mitigate an accidental DDoS after enabling ActivityPub for WordPress with the Surge plugin, I found an optimization for improved cache handling. Out of the box, there’s a problem with the default configuration since Surge ignores the Accept header.

[…]

epiph.yt/en/blog/2025/optimize

Epiphyt · Surge-Konfiguration für ActivityPub optimieren | EpiphytDas Plugin Surge ignoriert den für ActivityPub wichtigen Accept-Header. Durch eine clevere Lösung kannst du dafür eine eigene Cache-Version bereitstellen.

Ech kurde. Właśnie odkryłem, że plugin od cache psuje mi wyświetlanie map na blogu.

Gdy jestem zalogowany widzę na mapie wszystkie markery POI, profil wysokości trasy i mam możliwość pobrania pliku gpx, ale bez logowania jest tylko mapa z narysowaną trasą.

Znowu trzeba będzie dłubać, albo wyłączyć keszowanie całkiem, bo i tak nie ratuje bloga przed FediDDoS-em, a cała reszta ruchu jest znikoma.

Replied in thread

@corbet @LWN I sympathize, it's an exasperating problem. I've found microcaching all public facing content to be extremely effective.

- The web server sits behind a proxy micro cache
- Preseed the cache by crawling every valid public path
- Configure the valid life of cached content to be as short as you want
- Critically, ensure that every request is always served stale cached content while the cache leisurely repopulates with a fresh copy. This eliminates bot overwhelm by decoupling requests from ANY IP from the request rate hitting the upstream
- Rather than blocking aggressive crawlers, configure rate-limiting customized by profiling max predicted human rate
- For bots with known user agents, plus those detected by profiling their traffic, divert all their requests to a duplicate long lived cache that never invokes the upstream for updates

Micro caching has saved us thousands on compute, and eliminated weekly outages caused by abusive bots. It's open to significant tuning to improve efficiency based on your content.

Shout out to the infrastructure team at NPR@flipboard.com - a blog post they published 9 years ago (now long gone) described this approach.

Po tym jak przy ostatnich publikacjach na blogu, serwer dławił się na jakiś czas (najprawdopodobniej przez federację), wymieniłem plugin od cache z WP Super Cache na podobno lepszy LS Cache, licząc że dzięki temu żądania z instancji fedi pobierających kartę podglądu dla wpisu nie zamulą mi strony.

Rzeczywiście strona po wymianie pluginu śmigała żwawo, więc miałem nadzieję, że przy następnej publikacji będzie dobrze, ale gdy przyszło co do czego, to okazało się, że niestety nic to nie dało.

Pogrzebałbym teraz, ale panel też zwraca 500 i 503. Trzeba przeczekać napór i poszukać rozwiązania później.

Despite the #mastodon media #cache duration option being set to 14 (now 7) days, system/cache/accounts/ is 50gb. Blegh. Are there really that many different people tooting on my timeline?

$ du -sh *
18G avatars
36G headers

`tootctl media remove-orphans` cleared only 77MB.

`tootctl media remove --prune-profiles --days 90 --dry-run` claims to remove 36GB. That's all strangers I haven't fingered in more than 3 months? So retoots/boosts/replies/etc?

Today, we dropped our first post in a series about designing caches. This post by @xtrollyj00 introduces data locality, cache types, and the core concepts you'll need. By the end of the series, you'll have the knowledge to create your own high-performance cache! Read more here: fpgahero.com/blog/20241126-cac #FPGA #cache

The FPGA Hero · Cache me if you can #1: An Intro to What Caches Are and Why You Need One
More from The FPGA Hero