Download the PHP package tweekersnut/cache without Composer

On this page you can find all versions of the php package tweekersnut/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 cache

TweekersNut Cache

PHP Version

A high-performance, pluggable PHP caching library with Redis, file, session, and memory drivers.

TweekersNut Cache is a professional, production-ready caching solution designed to speed up backend processing, data fetching, and manipulation. It provides a unified interface for multiple cache drivers, making it easy to switch between different caching strategies without changing your code.


๐Ÿš€ Features


๐Ÿ“ฆ Installation

Install via Composer:

Requirements


๐ŸŽฏ Quick Start

Basic Usage

Static Facade Usage


๐Ÿ”ง Configuration

Redis Driver

Requirements: PHP Redis extension (ext-redis) or Predis library

Best For: High-traffic applications, distributed systems, shared cache across servers

File Cache Driver

Best For: Single-server applications, development, when Redis is unavailable

Session Cache Driver

Best For: Per-user caching, temporary user-specific data

Array (Memory) Cache Driver

Best For: Testing, single-request caching, temporary runtime data


๐Ÿ“š API Reference

Core Methods

get(string $key, mixed $default = null): mixed

Retrieve a value from cache.

set(string $key, mixed $value, ?int $ttl = null): bool

Store a value in cache.

has(string $key): bool

Check if a key exists in cache.

delete(string $key): bool

Remove a key from cache.

clear(): bool

Clear all cache entries (respects prefix).

remember(string $key, int $ttl, callable $callback): mixed

Get from cache or execute callback and store result.

increment(string $key, int $value = 1): int

Increment a numeric value.

decrement(string $key, int $value = 1): int

Decrement a numeric value.


๐Ÿ’ก Usage Examples

Caching Database Queries

Caching API Responses

Rate Limiting

Caching Heavy Computations

Session-Based User Preferences


๐Ÿ”„ Driver Comparison

Feature Redis File Session Array
Persistence โœ… Yes โœ… Yes โš ๏ธ Session only โŒ No
Multi-Server โœ… Yes โŒ No โŒ No โŒ No
Performance โšก Excellent โš ๏ธ Good โš ๏ธ Good โšก Excellent
Setup Required โœ… Redis server โŒ None โŒ None โŒ None
Memory Usage โš ๏ธ External โš ๏ธ Disk โš ๏ธ Session โš ๏ธ PHP memory
Best For Production Development User data Testing

๐ŸŽจ Advanced Features

Prefix/Namespacing

Avoid key collisions by using prefixes:

Multiple Cache Instances

Graceful Fallback


๐Ÿ† Best Practices

  1. Use appropriate TTL: Set reasonable expiration times to balance freshness and performance
  2. Prefix your keys: Avoid collisions, especially in shared environments
  3. Cache expensive operations: Database queries, API calls, complex calculations
  4. Use remember() pattern: Simplifies cache-or-execute logic
  5. Handle cache failures gracefully: Never let cache issues break your app
  6. Monitor cache hit rates: Optimize your caching strategy based on metrics
  7. Clear cache strategically: Invalidate when data changes, not on every request

๐Ÿงช Testing

The library includes a test suite. Run tests with PHPUnit:

๐ŸŽฅ Watch This Video

Click the video below to watch it directly on YouTube:

Watch the video

๐Ÿ‘‰ Click the image to open the video


๐Ÿ“„ License

This library is open-source software licensed under the MIT License.


๐Ÿ‘ฅ Author

TweekersNut Network


๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ› Support

If you encounter any issues or have questions:


๐ŸŽฏ Roadmap


Made with โค๏ธ by TweekersNut Network


All versions of cache with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
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 tweekersnut/cache contains the following files

Loading the files please wait ...