c.im is one of the many independent Mastodon servers you can use to participate in the fediverse.
C.IM is a general, mainly English-speaking Mastodon instance.

Server stats:

2.9K
active users

#Caching

2 posts1 participant0 posts today

Quick question for folks who understand HTTP caching on reverse proxies like Squid or Cloudflare. If I have a GET REST endpoint responding with 200 OK and the following headers:

Cache-Control: public, max-age=3600  
ETag: "123-a"

The proxy should cache and serve the response without hitting the underlying server more than once for the first hour, then send a request with If-Match: "123-a" when the cache goes stale, right? Is there any reason why it wouldn’t?

#http#caching#etag

New on the HB dev blog:

By leveraging a SQL database for caching, Solid Cache enables Rails applications to store a greater volume of data for extended periods, overcoming the limitations imposed by the cost and capacity of memory storage.

Read the article: honeybadger.io/blog/solid-cach

Honeybadger Developer BlogHow to use Solid Cache in RailsDive into this article to uncover how the database-backed Solid Cache in Rails can surprisingly outperform traditional memory-based caches.

Although frequently misunderstood, the HTTP Cache-Control header is crucial because it specifies caching mechanisms within requests and responses.  In its typical format, it reveals details as to how resources are stored, the location of the resource and the maximum age before expiring…

In our latest blog post, Kieran Larking highlights that the No-cache directive does not prevent caching and looks at typical caching behaviour directives and how to correctly use these directives to balance performance and security: pentestpartners.com/security-b

Updated Version of the apache http caching setup for snac, including proxy media

I already wrote about caching here.
Now I extended what I cache a bit.
This was because after enabling the option to proxy media, I've seen access to the file paths /x/ and /y/ in addition to the path were snac stores the media that I include in my own posts ( /s/ ).
There are two locations to proxy media, depending if you requests the media via the mastodon api or via the web. (/x/ and /y/), oh and I added the nodeinfo2.0 path too, because I've noticed it was queried all the time by a lot of instances and it gives me pleasure to see something cached handed out in the access logs. 🙂 (I guess it is actually irrelevant for the system resources)
This is the updated setup:
Enable the relevant modules:

a2enmod expires cache cache_disk

Be sure "htcacheclean" is running to clean up the old disk cache. (under debian see /etc/default/apache-htcacheclean or else the relevant systemd service or whatever)
Then add this to the httpd Virtualhost config:

<LocationMatch "^/social/[^/]+/[xys]/|^/social/nodeinfo_2_0">
CacheEnable disk
Header set Cache-Control "max-age=86400, public" "expr=%{REQUEST_STATUS} == 200"
ExpiresActive On
ExpiresDefault "access plus 86400 seconds"
</LocationMatch>
This will use the disk cache to cache everything under the $username/s/, /x/ and /y/ paths, as well as for the /nodeinfo_2_0 path, utilizing mod_expires to generate the appropriate cache headers (for lazy ones like me). In this case caching it for 1 day.
Further reading and all options are explained under https://httpd.apache.org/docs/2.4/caching.html (and ff)

The Header that I set here, on the condition of Status code 200, is needed for the path /y/, because snac set no-cache on that location and mod_expires will honor that if we don't override it. I set it to the same Cache-Control value as mod_expires would. (I use mod_expires because it will additionally calculate the date and put that in the expires header. (hence the name I guess 😀 )

#Fediverse #Hosting #ITNotes #apache2 #httpd #Ownyourdata #Server #Snac #Snac2 #Tipsandtricks #Tutorial #Debian #caching
:xmpp:
snikket.deMenel (@menel@snikket.de)121 following, 80 followers · See updated version here: https://snikket.de/social/menel/p/1740228486.456200 Original: After seeing **Improving snac Performance with Nginx Proxy Cache** from @itnotes@snac.it-notes.dragas.net via --- https://snac.it-notes.dragas.net/itnotes/p/1738139676.258050 https://it-notes.dragas.net/2025/01/29/improving-snac-performance-with-nginx-proxy-cache/ --- I decided to prematurely optimize and adjust this for my apache2 httpd server in debian where I run snac. I've never done any

Ordered map на Go

Omap — это пакет Golang для работы с потокобезопасными упорядоченными map. Упорядоченная map содержит map golang, list и mutex для выполнения функций упорядоченной map. Упорядоченная map— это map, которая запоминает порядок элементов. Map можно итерировать для извлечения элементов в том порядке, в котором они были добавлены.

habr.com/ru/articles/882828/

ХабрOrdered map на GoOmap — это пакет Golang для работы с потокобезопасными упорядоченными map. Упорядоченная map содержит map golang, list и mutex для выполнения функций упорядоченной map. Упорядоченная map— это map,...
#go#map#caching

Use manual chunks with Vite to facilitate dependency caching: sending less JS code to users of your app when possible! An optimisation I figured out when building a chunky app due to the usage of polyfills and client-side libraries recently.

soledadpenades.com/posts/2025/

soledadpenades.comUse manual chunks with Vite to facilitate dependency caching | soledad penadés
More from supersole

«#Joblib is a set of tools to provide lightweight pipelining in #Python In particular:

Joblib is optimized to be fast and robust on large data in particular and has specific optimizations for #numpy arrays. It is BSD-licensed.»

joblib.readthedocs.io/en/stabl

joblib.readthedocs.ioJoblib: running Python functions as pipeline jobs — joblib 1.4.2 documentation