diff --git a/README.md b/README.md index ca2706f..7621def 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,6 @@ [![license][license-badge]][LICENSE] -Includes: -* Twig helpers -* HTTP cache for full-page caching - ## Status Please note this software is in development, usage may change before the 1.0 release. @@ -23,11 +19,7 @@ Install via Composer: composer require strata/symfony-frontend:^0.8 ``` -See [installation](docs/installation.md) - -## Documentation - -See [docs](docs/README.md) +Please see [Strata Frontend installation docs](https://docs.strata.dev/frontend/getting-started/installation). ## Contributing diff --git a/composer.json b/composer.json index 7c566b1..ed8fd27 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "strata/symfony-frontend", - "description": "TODO", + "description": "Integration with Symfony framework for Strata Frontend", "type": "symfony-bundle", "license": "MIT", "authors": [ @@ -11,7 +11,7 @@ ], "require": { "php": ">=7.4", - "strata/frontend": "dev-release/0.8.0 as 0.8.0", + "strata/frontend": "^0.8", "symfony/http-kernel": "^5.3", "twig/twig": "^3.0", "symfony/framework-bundle": "^5.3" diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md deleted file mode 100644 index 687922a..0000000 --- a/docs/SUMMARY.md +++ /dev/null @@ -1,8 +0,0 @@ -# Overview - -* [Installation](installation.md) - -## Frontend docs - -* [Strata Frontend](https://docs.strata.dev/frontend/) -* [Twig helpers](https://docs.strata.dev/frontend/docs/templating/twig) diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index e970d7c..0000000 --- a/docs/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# Syfmony integration for Strata Frontend - -Please see main [Strata Frontend docs](https://docs.strata.dev/frontend/). - -See [documentation index](SUMMARY.md) diff --git a/docs/installation.md b/docs/installation.md deleted file mode 100644 index 2c64191..0000000 --- a/docs/installation.md +++ /dev/null @@ -1,100 +0,0 @@ -# Installation - -## Requirements - -These instructions assume you already have an existing [Symfony 5 application](https://symfony.com/doc/current/setup.html). - -* PHP 7.4+ -* Symfony 5.2+ - -## Composer - -``` -composer require strata/symfony-frontend:^0.8 -``` - -### During development of 0.8 branch - -Add to your `composer.json`: - -``` -{ - "minimum-stability": "dev", - "prefer-stable": true -} -``` - -Then run this composer command: -``` -composer require "strata/symfony-frontend:dev-release/0.8.0 as 0.8.0" -``` - -## Twig helpers - -Register these with your `config/services.yaml`: - -```yaml -# Register Frontend Twig helpers -Strata\Symfony\TwigExtension: - tags: ['twig.extension'] -``` - -## Full page caching - -Set default cache control response headers for full page caching. - -File: `src/EventListener/ResponseListener.php`: - -```php -getResponse(); - $response->setSharedMaxAge(CacheLifetime::HOUR); - $response->headers->addCacheControlDirective('must-revalidate', true); - } - } - -} -``` - -### Varnish -To use HTTP caching either use an HTTP cache proxy such as [Varnish Cache](https://varnish-cache.org/) or you can -make use of Symfony HTTP Cache with the setup below. - -With Varnish, it is still important to output the correct cache control headers to control how long pages are cached for. - -### Symfony HTTP Cache -_Note: HTTP cache will be updated to use foshttpcache and tag-based invalidation_ - -To use HTTP cache for frontend responses update your `public/index.php` bootstrap file. - -After the line: - -```php -$kernel = new Kernel($env, $debug); -``` - -Add: - -```php -// Enable HTTP Cache for prod -// @see https://symfony.com/doc/current/http_cache.html -if ('prod' === $env) { - $kernel = new CacheKernel($kernel); -} -```