Souin bundle for api-platform
$ composer require darkweak/souin-api-platform-bundle
# config/api_platform.yaml
api_platform:
# ... your previous configuration
http_cache:
invalidation:
enabled: true
Add the bundle into your bundles.php
file
// config/bundles.php
<?php
return [
// previous bundles
Darkweak\SouinApiPlatformBundle\SouinApiPlatformBundle::class => ['all' => true],
];
This is the minimal configuration for the SouinApiPlatform bundle.
# config/souin_api_platform.yaml
souin_api_platform: # Mandatory to enable the Souin API Platform bridge instead of the Varnish one
# config/souin_api_platform.yaml
souin_api_platform: # Mandatory to enable the Souin API Platform bridge instead of the Varnish one
base: # Declare the base url parameters
host: http://caddy # Your reverse-proxy
api_path: /souin-api
api: # Declare the api parameters
authentication: # Require a login to access the Souin security API
username: john # Your username defined in the Souin configuration
password: passw0rd # Your password defined in the Souin configuration
souin: # Declare the souin parameters
path: /souin-api # The Souin API path to manage the cache
If you have idea on how to improve this bundle, feel free to contribute. If you have problems or you found some bugs, please open an issue.