ZeroPing ZeroPing v2.0.1
Home Getting Started Installation Documentation Features API Roadmap Community
GitHub Star
Home Getting Started Installation Documentation Features API Roadmap Community GitHub GitHub
    Home Documentation Performance
  • Introduction
  • Installation
  • Getting Started
  • CLI Reference
  • Validation
  • Caching
  • Database & ORM
  • Service Container
  • Queues & Jobs
  • Task Scheduler
  • Security
  • Extending ZeroPing
  • Starter Templates
  • Search
  • Performance
  • Roadmap

Performance

ZeroPing includes several performance optimization features to speed up your application in production.

Route Caching

Route caching compiles all registered routes into a single optimized file, eliminating the need to parse config/routes.php on every request.

BASH
php zero route:cache

To clear the route cache:

BASH
php zero route:clear

Configuration Caching

Configuration caching merges all config files into a single array and writes it to a cached file. This avoids repeated require calls and file I/O on every request.

BASH
php zero config:cache

To clear the config cache:

BASH
php zero config:clear

View Caching

Compiled views are stored in storage/cache/views/. Once cached, views are served directly from the pre-compiled file without re-parsing the template.

BASH
php zero view:cache

To clear the view cache:

BASH
php zero view:clear

Optimize Command

The optimize command runs all caching operations at once:

BASH
php zero optimize

This runs:

1. config:cache — Cache configuration 2. route:cache — Cache routes 3. view:cache — Cache compiled views 4. search:index — Build search index

To clear everything:

BASH
php zero optimize:clear

Lazy Service Loading

Services are loaded lazily through the container. A service provider is only instantiated and registered when one of its services is first requested. This means:

  • Unused services consume zero memory
  • Request time is not spent booting providers that won't be used
  • Only the core routing and config systems are loaded eagerly

Best Practices

1. Run php zero optimize in deployment for maximum performance 2. Keep config files minimal — only load what you need 3. Use route caching in production environments 4. Cache views for any pages rendered more than once 5. Build the search index on deploy, not on first user request

Search
Roadmap

On this page

  • Route Caching
  • Configuration Caching
  • View Caching
  • Optimize Command
  • Lazy Service Loading
  • Best Practices
ESC

Type to search documentation...