Download the PHP package iperamuna/laravel-html-fragment-cache without Composer

On this page you can find all versions of the php package iperamuna/laravel-html-fragment-cache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-html-fragment-cache

Laravel HTML Fragment Cache

Latest Version on Packagist Total Downloads License

A lightweight, generic HTML fragment caching package for Laravel. Cache any rendered HTML by identifier (customer/org/user/etc.) with support for all Laravel cache drivers, Blade directives, and simple invalidation.

Features

Installation

You can install the package via Composer:

The package will automatically register its service provider and facade.

Publish Configuration (Optional)

This will publish config/fragment-cache.php where you can customize the default settings.

Configuration

The package uses Laravel's cache system and supports all cache drivers. You can configure which cache store to use and enable/disable caching globally:

Available Configuration Options

Enabling/Disabling Caching

You can globally enable or disable fragment caching using the enabled configuration option:

When caching is disabled:

Usage

Basic Usage with Facade

Blade Directive

The package provides a convenient Blade directive for quick caching:

You can also pass an array as identifier to include additional context:

Using the Trait

For more complex scenarios, use the UsesHtmlFragmentCache trait:

Livewire Integration

Perfect for caching expensive Livewire component rendering:

Using the Trait (Recommended)

Using the Facade

Cache Invalidation

Forget Specific Fragments

Artisan Commands

The package provides interactive Artisan commands for cache management:

The fragment-cache:forget command provides three modes:

Advanced Usage

Custom Identifier Resolution

You can customize how identifiers are resolved by modifying the configuration or creating a custom resolver:

Multiple Cache Stores

You can use different cache stores for different environments:

Performance Benefits

Testing

The test suite uses Orchestra Testbench with the array cache driver for portability.

Requirements

Cache Driver Support

Driver Support Notes
Array ✅ Full Perfect for testing
File ✅ Full Good for single-server setups
Database ✅ Full Persistent across servers
Redis ✅ Full High performance, recommended for production
Memcached ✅ Full High performance, in-memory
DynamoDB ✅ Full AWS managed cache
Octane ✅ Full Ultra-high performance

Contributing

Please see CONTRIBUTING.md for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Changelog

Please see CHANGELOG.md for more information on what has changed recently.


Made with ❤️ for the Laravel community


All versions of laravel-html-fragment-cache with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/support Version ^10.0 || ^11.0 || ^12.0
laravel/prompts Version ^0.3.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iperamuna/laravel-html-fragment-cache contains the following files

Loading the files please wait ...