Skip to content

Commit 9c4c463

Browse files
committed
Reduce leading levels
better formatting
1 parent 9363dc9 commit 9c4c463

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ As of writing, several Laravel cache drivers do not have automatic removal of ex
1414
- `file`
1515
- `database`
1616

17-
## Why is it a problem?
17+
### Why is it a problem?
1818
Using any of the above cache drivers without regularly removing the expired items (aka "key eviction" in Redis) can result in storage overload, especially when you are creating a lot of temporary items with random keys.
1919

2020
The `cache:clear` command from Laravel works, but might not be the thing you want. It does not check item expiry (it removes everything), and also clears the Laravel framework cache (e.g. `/bootstrap/cache/*`), which can be especially problematic when you are using the `file` cache driver (consider a case: cache items are created by the `www-data` user but `/bootstrap/cache/*` is owned by the `ubuntu` user).
@@ -23,14 +23,14 @@ In this case, this library can help you remove only the expired items in your ca
2323

2424
This library is designed to be memory efficient and (for `database` caches) non-blocking, so even if there are a lot of items in the cache (e.g. you are running this for the first time to deal with an oversized cache), it can still run reasonably well.
2525

26-
# Install
26+
## Install
2727
via Composer:
2828

2929
```sh
3030
composer require vectorial1024/laravel-cache-evict
3131
```
3232

33-
## Supported cache types
33+
### Supported cache types
3434
The following cache drivers from `cache.php` are currently supported:
3535
- `database`
3636
- `file`
@@ -39,7 +39,7 @@ Some drivers (e.g. `memcached`, `redis`) will never be supported because they ha
3939

4040
Custom eviction strategies can be defined for other cache drivers that does not have their own eviction mechanisms (see FAQ section).
4141

42-
# Usage
42+
## Usage
4343

4444
You may run this in the command line:
4545

@@ -66,7 +66,7 @@ Schedule::command(CacheEvictCommand::class)->daily()->runInBackground();
6666
Schedule::command(CacheEvictCommand::class, ['target' => 'file'])->daily()->runInBackground();
6767
```
6868

69-
## The relationship with `cache.php`
69+
### The relationship with `cache.php`
7070
This library checks the cache *name* (not *driver*!) inside `cache.php` to determine which cache to clear. This means, if you have the following `cache.php` ...
7171

7272
```php
@@ -93,16 +93,16 @@ php artisan cache:evict local_store
9393

9494
... then, you will only evict the `local_store` cache. The `another_store` cache is unaffected by this command (assuming both are using separate directories, of course).
9595

96-
# Testing
96+
## Testing
9797
Using `orchestra/testbench` (customized PHPUnit) via Composer:
9898

9999
```sh
100100
composer run-script test
101101
```
102102

103-
# Frequently-asked questions (FAQ)
103+
## Frequently-asked questions (FAQ)
104104

105-
## How to define custom eviction strategies?
105+
### How to define custom eviction strategies?
106106
You can do so inside your Laravel service provider. Simply do the following:
107107

108108
```php
@@ -117,7 +117,7 @@ public function boot()
117117
}
118118
```
119119

120-
## Will this library help me reclaim `database` disk spaces?
120+
### Will this library help me reclaim `database` disk spaces?
121121
No, but if you are using this library regularly to evict expired items, then you do not need to worry about reclaiming free space. For more details, talk with a system admin/database specialist.
122122

123123
[packagist-url]: https://packagist.org/packages/vectorial1024/laravel-cache-evict

0 commit comments

Comments
 (0)