Skip to content

Commit

Permalink
Fix minor issues in http cache (#2348)
Browse files Browse the repository at this point in the history
* Fix minor issues in http cache

---------

Co-authored-by: Marek Nocoń <mnocon@users.noreply.github.com>
  • Loading branch information
dabrt and mnocon committed Apr 3, 2024
1 parent 320003d commit b73162b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions docs/guide/cache/content_aware_cache.md
Expand Up @@ -258,7 +258,7 @@ See [Tagging from Twig Templates](https://foshttpcachebundle.readthedocs.io/en/l

`ezplatform-http-cache` uses Repository API event subscribers to listen to events emitted on Repository operations,
and depending on the operation triggers expiry on a specific tag or set of tags.
All event subscribers can be found in `ezplatform-http-cache/src/EventSubscriber/CachePurge`.
All event subscribers can be found in `http-cache/src/lib/EventSubscriber/CachePurge`.

### Tags purged on publish event

Expand Down Expand Up @@ -313,6 +313,7 @@ The new structure will then be:
```

The following keys will be purged during the move:

- `l20`, because cache for previous parent of `[Child]` should be purged (`[Parent1]`)
- `pl20`, because cache for children of `[Parent1]` should be purged
- `l21`, because cache for new parent of `[Child]` should be purged (`[Parent2]`)
Expand Down Expand Up @@ -522,7 +523,7 @@ not only headers) to curl and search for esi:
$ curl --resolve www.staging.foobar.com.us-2.platformsh.site:443:1.2.3.4 --header "Surrogate-Capability: abc=ESI/1.0" --header "x-user-hash: daea248406c0043e62997b37292bf93a8c91434e8661484983408897acd93814" https://www.staging.foobar.com.us-2.platformsh.site/ | grep esi
```

The output is :
The output is:

```HTML
<esi:include src="/_fragment?_hash=B%2BLUWB2kxTCc6nc5aEEn0eEqBSFar%2Br6jNm8fvSKdWU%3D&_path=locationId%3D2%26contentId%3D52%26blockId%3D11%26versionNo%3D3%26languageCode%3Deng-GB%26serialized_siteaccess%3D%257B%2522name%2522%253A%2522site%2522%252C%2522matchingType%2522%253A%2522default%2522%252C%2522matcher%2522%253Anull%252C%2522provider%2522%253Anull%257D%26serialized_siteaccess_matcher%3Dnull%26_format%3Dhtml%26_locale%3Den_GB%26_controller%3DEzSystems%255CEzPlatformPageFieldTypeBundle%255CController%255CBlockController%253A%253ArenderAction" />
Expand All @@ -540,7 +541,7 @@ shell.
$ curl -IXGET --resolve www.staging.foobar.com.us-2.platformsh.site:443:1.2.3.4 --header "Surrogate-Capability: abc=ESI/1.0" --header "x-user-hash: daea248406c0043e62997b37292bf93a8c91434e8661484983408897acd93814" 'https://www.staging.foobar.com.us-2.platformsh.site/_fragment?_hash=B%2BLUWB2kxTCc6nc5aEEn0eEqBSFar%2Br6jNm8fvSKdWU%3D&_path=locationId%3D2%26contentId%3D52%26blockId%3D11%26versionNo%3D3%26languageCode%3Deng-GB%26serialized_siteaccess%3D%257B%2522name%2522%253A%2522site%2522%252C%2522matchingType%2522%253A%2522default%2522%252C%2522matcher%2522%253Anull%252C%2522provider%2522%253Anull%257D%26serialized_siteaccess_matcher%3Dnull%26_format%3Dhtml%26_locale%3Den_GB%26_controller%3DEzSystems%255CEzPlatformPageFieldTypeBundle%255CController%255CBlockController%253A%253ArenderAction'
```

You can also note that this ESI is handled by a controller in the `EzPlatformPageFieldTypeBundle` bundle provided by [[= product_name =]].
You can also note that this ESI is handled by a controller in the `FieldTypePage` bundle provided by [[= product_name =]].

The output is:

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/cache/context_aware_cache.md
Expand Up @@ -203,6 +203,6 @@ public function addPreferenceHash(FilterResponseEvent $event)
```php
$response->setVary('X-User-Preference-Hash');

// If you _also_ need to vary on eZ permissions, instead use:
// If you _also_ need to vary on [[= product_name =]] permissions, instead use:
//$response->setVary(['X-Context-User-Hash', 'X-User-Preference-Hash']);
```
2 changes: 1 addition & 1 deletion docs/guide/cache/symfony_reverse_proxy.md
Expand Up @@ -6,7 +6,7 @@ description: You can use Symfony HttpCache Proxy, Varnish or Fastly as reverse p

## Using Symfony reverse proxy

To use the Symfony reverse proxy, you must change your `public/index.php` front controller script and wrap `EzSystems\PlatformHttpCacheBundle\AppCache` instead of `Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache` around the kernel.
To use the Symfony reverse proxy, you must change your `public/index.php` front controller script and wrap `Ibexa\Bundle\HttpCache\AppCache` instead of `Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache` around the kernel.

```diff
--- a/public/index.php
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/persistence_cache.md
Expand Up @@ -40,7 +40,7 @@ For further details on which calls are cached or not, see details in the [Symfon
which has info on cache use in two places:

- Symfony Cache tab: for Symfony Cache itself, the tab shows cache lookups to cache backends
- eZ Platform tab: shows calls made to database back end, and if they are cached or not
- [[= product_name_base =]] tab: shows calls made to database back end, and if they are cached or not

To see where and how to contribute additional caches, refer to the [source code](https://github.com/ezsystems/ezplatform-kernel/tree/v1.0.0/eZ/Publish/Core/Persistence/Cache).

Expand Down

0 comments on commit b73162b

Please sign in to comment.