nswdpc/silverstripe-cache-headers

Modify cache headers via configuration

Installs: 3 413

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

v1.0.0-rc1 2023-06-22 01:10 UTC

This package is auto-updated.

Last update: 2024-04-15 07:40:04 UTC


README

Default Silverstripe cache handling sends headers that are not considered cacheable by a proxy such as Cloudflare.

This module allows you to modify this behaviour via configuration, allowing a proxy to cache based on the headers sent by the application.

This module is in development and is not yet suitable for production environments

Usage

  • Install this extension using composer
  • Modify the configuration rules to your requirements
  • Test behind your caching proxy and deploy

Installation

Install via composer:

composer require nswdpc/silverstripe-cache-headers

Documentation

The priority of caching directives in Silverstripe are in this order as follows:

disableCache($force=true)
privateCache($force=true)
publicCache($force=true)
enableCache($force=true)
disableCache()
privateCache()
publicCache()
enableCache()

By default this module enables the cache (enableCache), but does not provide the force parameter as true.

See documentation for a primer on various options, including sample configurations.

License

BSD-3-Clause

Maintainers

Bugtracker

We welcome bug reports, pull requests and feature requests on the Github Issue tracker for this project.

Please review the code of conduct prior to opening a new issue.

Development and contribution

If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers.

Please review the code of conduct prior to completing a pull request.