Search by

eamirgh / optimus

eamirgh

High-performance image and asset optimization engine for Laravel

Package info

github.com/eamirgh/Optimus

pkg:composer/eamirgh/optimus

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

v1.0.1 2026-09-24 09:46 UTC

This package is auto-updated.

Last update: 2026-10-28 21:01:44 UTC


README

Tests & Benchmarks Deploy Documentation License: MIT

High-performance image and asset performance optimization engine for Laravel 11, 12, and 13.

Features

  • Blade Components: <x-image>, <x-link>, <x-script>, <x-ga>, @optimusCssBg.
  • Strategy Drivers: GD (ext-gd), Imagick (ext-imagick), Imgproxy (edge cluster), Cloudinary (SaaS).
  • Format Negotiation: Content-negotiated AVIF and WebP delivery based on HTTP Accept header.
  • Security & DoS Protection: HMAC-SHA256 URL signing and strict dimension whitelisting.
  • Thundering Herd Mitigation: Atomic cache lock serialization preventing cache stampedes.
  • Dual Architecture:
    • Low-Scale / Monolithic: Synchronous on-the-fly generation cached to disk (try_files friendly).
    • High-Scale / Distributed: Asynchronous variant pregeneration (GenerateImageVariantsJob) with Eloquent model trait (HasOptimusImages).
  • Secondary Compression: Post-processing execution of pngquant, jpegoptim, cwebp, gifsicle.
  • Cache Maintenance: php artisan optimus:clear-stale command.
  • Test Suite & Benchmarks: Full TDD unit & feature coverage with Orchestra Testbench and standalone benchmark suite.

Installation

composer require eamirgh/optimus
php artisan vendor:publish --tag=optimus-config

Running Tests, Benchmarks & Docs

cd optimus
make install       # Install composer and npm dependencies
make test          # Run PHPUnit test suite
make benchmark     # Run performance benchmark suite
make docs-dev      # Start local VitePress docs server
make docs-build    # Build production docs