
#use wml::openssl-macros area=docs page=SSL_CTX_sess_set_cache_size

<title>Documents, SSL_CTX_sess_set_cache_size(3)</title>

<h1>SSL_CTX_sess_set_cache_size(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_CTX_sess_set_cache_size, SSL_CTX_sess_get_cache_size - manipulate
session cache size

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, long t);
 long SSL_CTX_sess_get_cache_size(SSL_CTX *ctx);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_CTX_sess_set_cache_size()</CODE> sets the size of the internal
session cache of context <STRONG>ctx</STRONG> to <STRONG>t</STRONG>.

</P>
<P>
<CODE>SSL_CTX_sess_get_cache_size()</CODE> returns the currently valid
session cache size.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
The internal session cache size is SSL_SESSION_CACHE_MAX_SIZE_DEFAULT,
currently 1024*20, so that up to 20000 sessions can be held. This size can
be modified using the <CODE>SSL_CTX_sess_set_cache_size()</CODE> call. A
special case is the size 0, which is used for unlimited size.

</P>
<P>
When the maximum number of sessions is reached, no more new sessions are
added to the cache. New space may be added by calling
<A HREF="../ssl/SSL_CTX_flush_sessions.html#">SSL_CTX_flush_sessions(3)</A> to remove expired sessions.

</P>
<P>
If the size of the session cache is reduced and more sessions are already
in the session cache, old session will be removed at the next time a
session shall be added. This removal is not synchronized with the
expiration of sessions.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>SSL_CTX_sess_set_cache_size()</CODE> returns the previously valid
size.

</P>
<P>
<CODE>SSL_CTX_sess_get_cache_size()</CODE> returns the currently valid
size.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../ssl/ssl.html#">ssl(3)</A>,
<A HREF="../ssl/SSL_CTX_set_session_cache_mode.html#">SSL_CTX_set_session_cache_mode(3)</A>,
<A HREF="../ssl/SSL_CTX_sess_number.html#">SSL_CTX_sess_number(3)</A>,
<A HREF="../ssl/SSL_CTX_flush_sessions.html#">SSL_CTX_flush_sessions(3)</A>



</P>
:}


