LIBRESSL-SSL_CTX_SESS_SET_CACHE_SIZE(3)
okay so this is the SSL_CTX_SESS_SET_CACHE_S(3) page from the Library Functions Manual, and it's literally your group chat for wrangling session cache size π
β¨
π NAME π
SSL_CTX_sess_set_cache_size, SSL_CTX_sess_get_cache_size β manipulate session cache size
β¨ SYNOPSIS β¨
library βlibsslβ libcrypto #include <openssl/ssl.h>
long
SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, long t);
long
SSL_CTX_sess_get_cache_size(SSL_CTX *ctx);
πΈ DESCRIPTION πΈ
okay bestie, here's the tea β: SSL_CTX_sess_set_cache_size() sets the size of the internal session cache of context ctx to t. that's the whole assignment, slay π
SSL_CTX_sess_get_cache_size() returns the currently valid session cache size β like, βhey, how big is the cache rn?β energy π¦
the internal session cache size is SSL_SESSION_CACHE_MAX_SIZE_DEFAULT, currently 1024Γ20, so that up to 20000 sessions can be held. iconic capacity, no cap π
you can modify this size using the SSL_CTX_sess_set_cache_size() call. a special case is the size 0, which is used for unlimited size. zero means unlimited here, so don't come for me about math class π
if adding the session makes the cache exceed its size, then unused sessions are dropped from the end of the cache. cache space may also be reclaimed by calling SSL_CTX_flush_sessions(3) to remove expired sessions. spring cleaning, but make it TLS π§Ήβ¨
if the size of the session cache is reduced and more sessions are already in the session cache, old session will be removed the next time a session shall be added. this removal is not synchronized with the expiration of sessions. so yeah, it's giving βcleanup happens on the next add,β not βinstant cleanup,β and it is not synchronized with the expiration of sessions β lowkey important, don't forget it π«Ά
π RETURN VALUES π
SSL_CTX_sess_set_cache_size()returns the previously valid size.SSL_CTX_sess_get_cache_size()returns the currently valid size.
π¦ SEE ALSO π¦
ssl(3), SSL_CTX_ctrl(3), SSL_CTX_flush_sessions(3), SSL_CTX_sess_number(3), SSL_CTX_set_session_cache_mode(3)
π HISTORY π
SSL_CTX_sess_set_cache_size() and SSL_CTX_sess_get_cache_size() first appeared in SSLeay 0.9.0 and have been available since OpenBSD 2.4. vintage behavior, honestly π
kisses and cache hugs π this page is from Debian, dated June 8, 2025, and the footer tag is SSL_CTX_SESS_SET_CACHE_SIZE(3) π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2001, 2002, 2014 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms