Movatterモバイル変換


[0]ホーム

URL:


Modules |Directives |FAQ |Glossary |Sitemap

Apache HTTP Server Version 2.4

<-
Apache >HTTP Server >Documentation >Version 2.4 >Modules

Apache Module mod_cache_socache

Available Languages: en  | fr 

Description:Shared object cache (socache) based storage module for theHTTP caching filter.
Status:Extension
Module Identifier:cache_socache_module
Source File:mod_cache_socache.c

Summary

mod_cache_socache implements a shared object cache (socache) based storage manager formod_cache.

The headers and bodies of cached responses are combined, and stored underneath a single key in the shared object cache. Anumber of implementations of shared object caches are available to choose from.

Multiple content negotiated responses can be stored concurrently, however the caching of partial content is not yet supported by this module.

# Turn on cachingCacheSocache shmcbCacheSocacheMaxSize 102400<Location "/foo">    CacheEnable socache</Location># Fall back to the disk cacheCacheSocache shmcbCacheSocacheMaxSize 102400<Location "/foo">    CacheEnable socache    CacheEnable disk</Location>

Note:

mod_cache_socache requires the services ofmod_cache, which must be loaded beforemod_cache_socache.

Support Apache!

Directives

Bugfix checklist

See also

top

CacheSocacheDirective

Description:The shared object cache implementation to use
Syntax:CacheSocachetype[:args]
Context:server config, virtual host
Status:Extension
Module:mod_cache_socache
Compatibility:Available in Apache 2.4.5 and later

TheCacheSocache directive defines the name of the shared object cache implementation to use, followed by optional arguments for that implementation. Anumber of implementations of shared object caches are available to choose from.

CacheSocache shmcb
top

CacheSocacheMaxSizeDirective

Description:The maximum size (in bytes) of an entry to be placed in thecache
Syntax:CacheSocacheMaxSizebytes
Default:CacheSocacheMaxSize 102400
Context:server config, virtual host, directory, .htaccess
Status:Extension
Module:mod_cache_socache
Compatibility:Available in Apache 2.4.5 and later

TheCacheSocacheMaxSize directive sets the maximum size, in bytes, for the combined headers and body of a document to be considered for storage in the cache. The larger the headers that are stored alongside the body, the smaller the body may be.

Themod_cache_socache module will only attempt to cache responses that have an explicit content length, or that are small enough to be written in one pass. This is done to allow themod_cache_disk module to have an opportunity to cache responses larger than those cacheable withinmod_cache_socache.

CacheSocacheMaxSize 102400
top

CacheSocacheMaxTimeDirective

Description:The maximum time (in seconds) for a document to be placed in thecache
Syntax:CacheSocacheMaxTimeseconds
Default:CacheSocacheMaxTime 86400
Context:server config, virtual host, directory, .htaccess
Status:Extension
Module:mod_cache_socache
Compatibility:Available in Apache 2.4.5 and later

TheCacheSocacheMaxTime directive sets the maximum freshness lifetime, in seconds, for a document to be stored in the cache. This value overrides the freshness lifetime defined for the document by the HTTP protocol.

CacheSocacheMaxTime 86400
top

CacheSocacheMinTimeDirective

Description:The minimum time (in seconds) for a document to be placed in thecache
Syntax:CacheSocacheMinTimeseconds
Default:CacheSocacheMinTime 600
Context:server config, virtual host, directory, .htaccess
Status:Extension
Module:mod_cache_socache
Compatibility:Available in Apache 2.4.5 and later

TheCacheSocacheMinTime directive sets the amount of seconds beyond the freshness lifetime of the response that the response should be cached for in the shared object cache. If a response is only stored for its freshness lifetime, there will be no opportunity to revalidate the response to make it fresh again.

CacheSocacheMinTime 600
top

CacheSocacheReadSizeDirective

Description:The minimum size (in bytes) of the document to read and be cached before sending the data downstream
Syntax:CacheSocacheReadSizebytes
Default:CacheSocacheReadSize 0
Context:server config, virtual host, directory, .htaccess
Status:Extension
Module:mod_cache_socache
Compatibility:Available in Apache 2.4.5 and later

TheCacheSocacheReadSize directive sets the minimum amount of data, in bytes, to be read from the backend before the data is sent to the client. The default of zero causes all data read of any size to be passed downstream to the client immediately as it arrives. Setting this to a higher value causes the disk cache to buffer at least this amount before sending the result to the client. This can improve performance when caching content from a slow reverse proxy.

This directive only takes effect when the data is being saved to the cache, as opposed to data being served from the cache.

CacheSocacheReadSize 102400
top

CacheSocacheReadTimeDirective

Description:The minimum time (in milliseconds) that should elapse while reading before data is sent downstream
Syntax:CacheSocacheReadTimemilliseconds
Default:CacheSocacheReadTime 0
Context:server config, virtual host, directory, .htaccess
Status:Extension
Module:mod_cache_socache
Compatibility:Available in Apache 2.4.5 and later

TheCacheSocacheReadTime directive sets the minimum amount of elapsed time that should pass before making an attempt to send data downstream to the client. During the time period, data will be buffered before sending the result to the client. This can improve performance when caching content from a reverse proxy.

The default of zero disables this option.

This directive only takes effect when the data is being saved to the cache, as opposed to data being served from the cache. It is recommended that this option be used alongside theCacheSocacheReadSize directive to ensure that the server does not buffer excessively should data arrive faster than expected.

CacheSocacheReadTime 1000

Available Languages: en  | fr 

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Libera.chat, or sent to ourmailing lists.

Copyright 2025 The Apache Software Foundation.
Licensed under theApache License, Version 2.0.

Modules |Directives |FAQ |Glossary |Sitemap


[8]ページ先頭

©2009-2025 Movatter.jp