Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Supercache Bundle Laravel Package

pablok/supercache-bundle

A Symfony bundle that integrates the SuperCache caching library into your application, providing service configuration and cache management for faster page delivery. It wires caching services into the Symfony container so you can enable, configure, and use SuperCache with minimal setup.

View on GitHub
Deep Wiki
Context7

Getting Started

Reality check first: pablok/supercache-bundle is a Symfony bundle, not a Laravel package. As a Laravel developer you cannot composer require it into a Laravel app and expect it to work — it hooks into Symfony's kernel, DI container, and configuration loader. Treat it as a reference implementation to read, not a dependency to install. With 1 star, 0 dependents, an archived repo, and a final release from 2018-12-09, it is effectively unmaintained.

Minimal steps to investigate it:

  1. Read composer.json first. Check the require block for permitted symfony/* and php versions. Anything pinned to ^2.8|^3.0|^4.0 and php ^7.0 will refuse to install on a modern PHP 8 / Symfony 5+ app, and tells you immediately that the code is a time capsule.
  2. Open src/ and find the bundle class (typically Pablok\SupercacheBundle\SupercacheBundle or similar). From there follow DependencyInjection/ (the *Extension + Configuration classes) to see what services and config keys the bundle registers. That is the real API surface.
  3. Scan for the value proposition. Look for cache-related services, an annotation/attribute reader, an event subscriber on kernel.response, or an HTTP cache warmer. That tells you whether "supercache" here means HTTP caching, response caching, or a generic cache-pool convenience wrapper.
  4. Try it in a throwaway Symfony 3.4/4.x skeleton only if you want to run it; otherwise static reading is enough. Register the bundle in AppKernel.php/bundles.php and dump the container (bin/console debug:container) to see what it actually exposes.
  5. First use case for a Laravel developer: don't integrate — harvest the pattern. If the bundle caches controller responses via annotations, the Laravel equivalent is a route middleware built on Cache::remember() + Response cache headers. If it wraps a PSR-6/PSR-16 pool, the Laravel equivalent is a decorator over Illuminate\Contracts\Cache\Repository.

If you were hoping for a drop-in supercache layer, the honest answer is: adopt spatie/laravel-responsecache or Symfony's built-in HttpCache/symfony/cache instead — both are maintained and documented.

Implementation Patterns

Because the package is a Symfony bundle, "patterns" split into (a) how the bundle is structured and (b) how to translate those ideas into Laravel.

How the bundle is wired (Symfony idiom):

  • DI extension + Configuration tree — a Configuration class defines the config schema (supercache: { ... } in YAML), and the extension translates it into container parameters and service definitions. This is the main extension point.
  • Service decoration / compiler passes — anything advertised as "super" caching usually decorates an existing service (e.g., a cache pool, a router, a client) rather than replacing it. Look for decorates: in service config.
  • Event subscribers — response-level caching is normally implemented as a kernel.response listener that adds Cache-Control/ETag/Last-Modified. If present, this is the highest-value part to copy.
  • Annotations — 2018-era bundles often expose @Cache(...) style annotations read via doctrine/annotations. Modern Symfony replaced these with PHP attributes; a Laravel port would use middleware parameters or route middleware groups instead.

Translating to Laravel day-to-day:

  • Response caching pattern (if the bundle caches controller output):
    // app/Http/Middleware/SupercacheResponse.php
    public function handle($request, Closure $next, int $ttl = 60)
    {
        $key = 'supercache:'.sha1($request->fullUrl());
        return Cache::remember($key, $ttl, fn () => $next($request));
    }
    
    Register as route middleware and apply to read-heavy GET routes. This mirrors the Symfony listener approach and is the most direct equivalent.
  • Cache-pool decorator pattern (if the bundle wraps a pool): implement Illuminate\Contracts\Cache\Repository, delegate to the underlying store, add tagging/namespacing/remember semantics in the decorator, and bind it in a service provider.
  • HTTP header pattern (if it just sets cache headers): use Laravel's Response::setCache() / setEtag() / setLastModified() in a middleware or in the controller — no package needed.
  • Config translation: map the bundle's Configuration tree to a config/supercache.php file and read with config('supercache.…'); keep the same key names so the mental model transfers.

Integration tips:

  • Keep cache keys deterministic and request-scoped (fullUrl + relevant headers + auth id) to avoid leaking one user's response to another.
  • If the bundle supports tagging/invalidation, replicate with Laravel's Cache::tags() only on stores that support it (Redis, Memcached, array) — file/database stores do not.
  • Prefer decorators + middleware over forking the bundle's internals; that keeps you upgradeable when you eventually drop the copied code.

Gotchas and Tips

  • It is abandoned and archived. No security patches, no PHP 8 compatibility fixes, no Symfony 5/6/7 support. Do not put this in a production dependency graph.
  • Composer will likely reject it on a modern stack due to php/symfony/* constraints, or it will install but fatal on removed APIs (Symfony\Component\HttpKernel\… signatures changed repeatedly since 2018). Use composer why-not to confirm before wasting time.
  • Symfony vs Laravel mismatch is the primary gotcha. There is no Laravel service provider, no facade, no config publish tag. Any tutorial or snippet you find assumes bin/console, YAML config, and the Symfony container.
  • No Flex recipe. Installation is manual: register the bundle in bundles.php, add config under config/packages/, and clear the cache. On Symfony 3.x it is AppKernel.php instead — check which era the README targets.
  • Docs are effectively nonexistent. With 1 star and 0 dependents, there is no community Q&A to fall back on. Rely on reading src/ and the Configuration class; that file is the definitive list of options.
  • Debugging (if you do run it): bin/console debug:container --tag=… and debug:config supercache will show what is registered; the Symfony profiler's cache panel shows hits/misses. In Laravel, the equivalent is Cache::getStore() inspection, Telescope's cache panel, and php artisan route:list -v to confirm middleware wiring.
  • Extension points are narrow. The likely levers are the Configuration tree and service decoration. If the bundle hard-codes its cache key or TTL strategy, there is no clean override — another reason to port the idea rather than depend on the code.
  • Licensing is fine (MIT) if you copy snippets, but keep the copyright notice and note the provenance; the value here is the pattern, not the package.
  • Recommendation: cite it as prior art in a design doc, then implement with symfony/cache (Symfony) or spatie/laravel-responsecache + Illuminate\Cache (Laravel). Both are actively maintained and solve the same day-to-day problems without the 2018 baggage.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect