1=pod 2 3=head1 NAME 4 5SSL_CTX_sess_set_cache_size, SSL_CTX_sess_get_cache_size - manipulate session cache size 6 7=head1 SYNOPSIS 8 9 #include <openssl/ssl.h> 10 11 long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, long t); 12 long SSL_CTX_sess_get_cache_size(SSL_CTX *ctx); 13 14=head1 DESCRIPTION 15 16SSL_CTX_sess_set_cache_size() sets the size of the internal session cache 17of context B<ctx> to B<t>. 18This value is a hint and not an absolute; see the notes below. 19 20SSL_CTX_sess_get_cache_size() returns the currently valid session cache size. 21 22=head1 NOTES 23 24The internal session cache size is SSL_SESSION_CACHE_MAX_SIZE_DEFAULT, 25currently 1024*20, so that up to 20000 sessions can be held. This size 26can be modified using the SSL_CTX_sess_set_cache_size() call. A special 27case is the size 0, which is used for unlimited size. 28 29If adding the session makes the cache exceed its size, then unused 30sessions are dropped from the end of the cache. 31Cache space may also be reclaimed by calling 32L<SSL_CTX_flush_sessions(3)> to remove 33expired sessions. 34 35If the size of the session cache is reduced and more sessions are already 36in the session cache, old session will be removed at the next time a 37session shall be added. This removal is not synchronized with the 38expiration of sessions. 39 40=head1 RETURN VALUES 41 42SSL_CTX_sess_set_cache_size() returns the previously valid size. 43 44SSL_CTX_sess_get_cache_size() returns the currently valid size. 45 46=head1 SEE ALSO 47 48L<ssl(7)>, 49L<SSL_CTX_set_session_cache_mode(3)>, 50L<SSL_CTX_sess_number(3)>, 51L<SSL_CTX_flush_sessions(3)> 52 53=head1 COPYRIGHT 54 55Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. 56 57Licensed under the Apache License 2.0 (the "License"). You may not use 58this file except in compliance with the License. You can obtain a copy 59in the file LICENSE in the source distribution or at 60L<https://www.openssl.org/source/license.html>. 61 62=cut 63