LLMS_Cache_Helper::additional_nocache_headers( array $headers )
Set additional nocache headers.
Description Description
See also See also
Parameters Parameters
- $headers
-
(array) (Required) Header names and field values.
- 'Expires'
(string) Expires header. - 'Cache-Control'
(string) Cache-Control header.
- 'Expires'
Return Return
(array)
Source Source
File: includes/class.llms.cache.helper.php
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | public static function additional_nocache_headers( $headers ) { // First tree are the default ones. $nocache_headers_cache_control = array ( 'no-cache' , 'must-revalidate' , 'max-age=0' , 'no-store' , ); if ( ! empty ( $headers [ 'Cache-Control' ] ) ) { $original_headers_cache_control = array_map ( 'trim' , explode ( ',' , $headers [ 'Cache-Control' ] ) ); // Merge original headers with our nocache headers. $nocache_headers_cache_control = array_merge ( $nocache_headers_cache_control , $original_headers_cache_control ); // Avoid duplicates. $nocache_headers_cache_control = array_unique ( $nocache_headers_cache_control ); } $headers [ 'Cache-Control' ] = implode( ', ' , $nocache_headers_cache_control ); return $headers ; } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.4.0 | Introduced. |