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
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. |