Download the PHP package phillarmonic/staccache-bundle without Composer

On this page you can find all versions of the php package phillarmonic/staccache-bundle. 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 staccache-bundle

Staccache Bundle Documentation

A Symfony bundle for efficient Doctrine entity caching with locking support

Overview

The Staccache Bundle provides an easy way to implement entity caching in Symfony applications using Redis. It improves application performance by reducing database queries for frequently accessed entities. Key features include:

Installation

1. Install the bundle with Composer

2. Register the bundle in your application

For Symfony Flex applications, the bundle will be automatically registered. For manual registration, add it to your config/bundles.php:

3. Configure Redis connection

Create a configuration file at config/packages/staccache.yaml:

Basic Usage

Marking Entities as Cacheable

Add the #[Staccacheable] attribute to entity classes you want to cache:

Configuration Options

The #[Staccacheable] attribute accepts the following parameters:

Advanced Usage

Using Repository Methods

The bundle provides a CachedServiceEntityRepository base class that adds caching capabilities to your repositories:

Controller Argument Resolution

The bundle automatically resolves entity arguments in controllers, using the cache when possible:

Cache Bypass Methods

When using the CachedServiceEntityRepository, you can bypass the cache for specific operations:

Manual Cache Management

You can directly use the EntityCacheManager and QueryCacheManager services:

Cache Purging

The bundle provides a command to purge the cache:

Configuration Reference

Here's the complete configuration reference:

Integrations

SNC Redis Bundle Integration

If you're using the SNC Redis Bundle, you can configure Staccache to use an existing Redis client:

Form Integration

The bundle automatically updates cached entities on form submission:

Performance Considerations

When to Use Caching

Entity caching is most effective for:

When to Avoid Caching

Memory Usage

Monitor your Redis memory usage, especially when caching large collections or entities with many relationships.

Troubleshooting

Cache Not Being Used

  1. Verify that your entity has the #[Staccacheable] attribute
  2. Check Redis connection and configuration
  3. Use the command bin/console staccache:purge --all --dry-run to see if any cache entries exist

Entity Changes Not Reflected

  1. Entity might be cached for longer than expected (check TTL configuration)

  2. Cache invalidation might be failing (check logs for errors)

  3. Try manually invalidating the cache:

Redis Connection Issues

  1. Verify Redis connection parameters
  2. Check if Redis server is running and accessible
  3. Ensure proper authentication if Redis requires password

Best Practices

  1. Set appropriate TTL values based on how frequently entities change
  2. Use fine-grained cache keys for queries
  3. Implement cache warmup for critical entities
  4. Monitor Redis memory usage
  5. Consider cache versioning for major data structure changes

Additional Resources

Logging

The bundle uses a dedicated logging channel staccache. Configure it in your Monolog configuration:

Then, configure the logger in your Staccache configuration:

Performance Monitoring

To monitor cache hit rates and performance, consider implementing metrics collection:


All versions of staccache-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/framework-bundle Version ^6.0|^7.0
symfony/lock Version ^6.0|^7.0
symfony/serializer Version ^6.0|^7.0
symfony/property-access Version ^6.0|^7.0
symfony/form Version ^7.2
doctrine/orm Version ^2.0|^3.0
doctrine/doctrine-bundle Version ^2.13
predis/predis Version ^1.1|^2.0
monolog/monolog Version ^2.0|^3.0
ext-redis Version *
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 phillarmonic/staccache-bundle contains the following files

Loading the files please wait ...