PHPackages                             opencontent/ocfoshttpcache-ls - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. opencontent/ocfoshttpcache-ls

ActiveEzpublish-legacy-extension[Caching](/categories/caching)

opencontent/ocfoshttpcache-ls
=============================

OpenContent FosHttpCache for eZPublish Legacy

05.7k↓50%1PHP

Since Oct 17Pushed 6mo ago5 watchersCompare

[ Source](https://github.com/OpencontentCoop/ocfoshttpcache)[ Packagist](https://packagist.org/packages/opencontent/ocfoshttpcache-ls)[ RSS](/packages/opencontent-ocfoshttpcache-ls/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

OpenContent FosHttpCache for eZPublish Legacy
=============================================

[](#opencontent-foshttpcache-for-ezpublish-legacy)

L'estensione integra la libreria [FosHttpCache](https://foshttpcache.readthedocs.io/en/latest/index.html) in eZ Publish 4.x (Legacy)

Il principale vantaggio è la possibilità di cacheare pagine in base allo User Context utilizzando [il metodo usato da FosHttpCache](https://foshttpcache.readthedocs.io/en/latest/user-context.html)

Installazione
-------------

[](#installazione)

- Configurare Varnish (vedi doc/default.vcl)
- Impostare in `site.ini` i `HTTPHeaderSettings`, ad esempio:

```
[HTTPHeaderSettings]
CustomHeader=enabled
OnlyForAnonymous=disabled
OnlyForContent=enabled
Cache-Control[]
Cache-Control[/]=public, must-revalidate, max-age=259200, s-maxage=259200
HeaderList[]=Vary
Vary[/]=X-User-Context-Hash

```

- Installare e configurare l'estensione
- Rigenerare gli autoloads e svuotare cache degli ini

Configurazione
--------------

[](#configurazione)

Configurare l'endpont Varnish e la porta oppure gli ip in `site.ini`:

```
[VarnishSettings]
VarnishHostName=varnish.example.com
VarnishPort=80
VarnishServers[]=10.0.0.1:1234
VarnishServers[]=127.0.0.1:80

```

oppure usando un `[Event]Listeners[]=ocfoshttpcache/varnish_server@MyVarnishServerCallable`

E' possibile configurare l'estensione perché utilizzi la `StaticCache` (configurazione di default) in `site.ini`:

```
[ContentSettings]
StaticCache=enabled
StaticCacheHandler=Opencontent\FosHttpCache\StaticCache

```

Invalidamento della cache di Varnish
------------------------------------

[](#invalidamento-della-cache-di-varnish)

Per l'invalidamento della cache è previsto un header custom `X-Instance` configurabile in `site.ini`

```
[HTTPHeaderSettings]
HeaderList[]=X-Instance
X-Instance[/]=example

```

oppure usando un `[Event]Listeners[]=ocfoshttpcache/instance_identifier@MyIdentifierCallable`

E' consigliato impostare l'header anche a livello di VirtualHost in modo da taggare anche gli asset e le immagini.

Note
----

[](#note)

L'handler di `StaticCache` considera i valori di `site.ini [ContentSettings]CacheThreshold` per calcolare se svuotare o meno tutta la cache.

L'accesso al modulo `_fos_user_context_hash` è garantito dal blocco in `site.ini`:

```
[RoleSettings]
PolicyOmitList[]=_fos_user_context_hash

```

Per invalidare selettivamente la cache di Varnish è disponibile il modulo `varnish/dashboard`

Todo
----

[](#todo)

Sono disponibili operatori di template per inserire tag custom

```
{fos_httpcache_tag('mytag')}
{fos_httpcache_tag(['tag-one', 'tag-two'])}

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance46

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4bb0695337c30a80b955ef72819273442a7dcbcfd69f99b80a28084d170bba0a?d=identicon)[Opencontent](/maintainers/Opencontent)

---

Top Contributors

[![lrealdi](https://avatars.githubusercontent.com/u/14081241?v=4)](https://github.com/lrealdi "lrealdi (12 commits)")[![Opencontent](https://avatars.githubusercontent.com/u/972033?v=4)](https://github.com/Opencontent "Opencontent (2 commits)")

### Embed Badge

![Health badge](/badges/opencontent-ocfoshttpcache-ls/health.svg)

```
[![Health](https://phpackages.com/badges/opencontent-ocfoshttpcache-ls/health.svg)](https://phpackages.com/packages/opencontent-ocfoshttpcache-ls)
```

###  Alternatives

[predis/predis

A flexible and feature-complete Redis/Valkey client for PHP.

7.8k305.7M2.4k](/packages/predis-predis)[snc/redis-bundle

A Redis bundle for Symfony

1.0k39.4M67](/packages/snc-redis-bundle)[react/cache

Async, Promise-based cache interface for ReactPHP

444112.4M40](/packages/react-cache)[wp-media/wp-rocket

Performance optimization plugin for WordPress

7431.3M3](/packages/wp-media-wp-rocket)[illuminate/cache

The Illuminate Cache package.

12835.6M1.4k](/packages/illuminate-cache)[colinmollenhour/php-redis-session-abstract

A Redis-based session handler with optimistic locking

6325.6M14](/packages/colinmollenhour-php-redis-session-abstract)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
