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

06.1k↑123.8%1PHP

Since Apr 5Pushed 4mo 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 1w ago

READMEChangelogDependenciesVersions (2)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

26

—

LowBetter than 40% of packages

Maintenance51

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% 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)")[![lorello](https://avatars.githubusercontent.com/u/694058?v=4)](https://github.com/lorello "lorello (1 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

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

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