承接 paneidos/laravel-tagged-cache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

paneidos/laravel-tagged-cache

Composer 安装命令:

composer require paneidos/laravel-tagged-cache

包简介

Force a tag on your cache, allowing you to share memcache instances.

README 文档

README

build status

Laravel Tagged Cache

Force a certain tag on your cache.

Why would I need this?

If you use the same Memcache server for multiple projects/tenants, it might be difficult to flush the cache for only one of them. The only options is to flush the entire cache. Using Laravel's built in TaggableStore, it's possible to flush the cache for only one project/tenant.

How does it work?

The tagged cache driver is a simple wrapper for another cache driver. All regular access to cache keys, such as get, put and remember, are forced to use the tags method and include the specified tag. Other special methods, such as lock are passed through without modification.

Installation

To get started with Laravel Tagged Cache, use Composer to add the package to your project's dependencies:

composer require paneidos/laravel-tagged-cache

Config

Specify a tagged store in your config/cache.php:

return [
    'stores' => [
        'memcache-tagged' => [
            'driver' => 'tagged',
            'backend' => 'memcache',
            'tag' => 'project_name',
        ],
        'memcache' => [
            // ...
        ],
        // ...
    ],
];

Example: replace your default store

return [
    'default' => 'tagged',
    
    'stores' => [
        'tagged' => [
            'driver' => 'tagged',
            'backend' => env('CACHE_DRIVER', 'array'),
            // Use the database name as the forced tag
            'tag' => env('DB_DATABASE', 'none'),
        ],
        // ...
    ],
];

Compatibility

Currently works with Laravel 5.6 and higher. The backend can be any store with support for tags. Note: the file store does not support tags.

Development

# Install dependencies
composer install
# Run tests
composer test
# Run tests & report coverage
composer test -- --coverage-text

Contributing

Send a pull request, ensure you've got test coverage for the new code.

License

Laravel Tagged Cache is licensed under the MIT License.

统计信息

  • 总下载量: 5.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-05-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固