172613Skris=pod 272613Skris 372613Skris=head1 NAME 472613Skris 572613SkrisSSL_CTX_sess_set_cache_size, SSL_CTX_sess_get_cache_size - manipulate session cache size 672613Skris 772613Skris=head1 SYNOPSIS 872613Skris 972613Skris #include <openssl/ssl.h> 1072613Skris 1172613Skris long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, long t); 1272613Skris long SSL_CTX_sess_get_cache_size(SSL_CTX *ctx); 1372613Skris 1472613Skris=head1 DESCRIPTION 1572613Skris 1672613SkrisSSL_CTX_sess_set_cache_size() sets the size of the internal session cache 1772613Skrisof context B<ctx> to B<t>. 18290207SjkimThis value is a hint and not an absolute; see the notes below. 1972613Skris 2072613SkrisSSL_CTX_sess_get_cache_size() returns the currently valid session cache size. 2172613Skris 2272613Skris=head1 NOTES 2372613Skris 2472613SkrisThe internal session cache size is SSL_SESSION_CACHE_MAX_SIZE_DEFAULT, 2572613Skriscurrently 1024*20, so that up to 20000 sessions can be held. This size 2672613Skriscan be modified using the SSL_CTX_sess_set_cache_size() call. A special 2772613Skriscase is the size 0, which is used for unlimited size. 2872613Skris 29290207SjkimIf adding the session makes the cache exceed its size, then unused 30290207Sjkimsessions are dropped from the end of the cache. 31290207SjkimCache space may also be reclaimed by calling 32100936SnectarL<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)> to remove 3372613Skrisexpired sessions. 3472613Skris 3572613SkrisIf the size of the session cache is reduced and more sessions are already 3672613Skrisin the session cache, old session will be removed at the next time a 3772613Skrissession shall be added. This removal is not synchronized with the 3872613Skrisexpiration of sessions. 3972613Skris 4072613Skris=head1 RETURN VALUES 4172613Skris 4272613SkrisSSL_CTX_sess_set_cache_size() returns the previously valid size. 4372613Skris 4472613SkrisSSL_CTX_sess_get_cache_size() returns the currently valid size. 4572613Skris 4672613Skris=head1 SEE ALSO 4772613Skris 4872613SkrisL<ssl(3)|ssl(3)>, 4972613SkrisL<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>, 5076866SkrisL<SSL_CTX_sess_number(3)|SSL_CTX_sess_number(3)>, 51100936SnectarL<SSL_CTX_flush_sessions(3)|SSL_CTX_flush_sessions(3)> 5272613Skris 5372613Skris=cut 54