folded-php / folded-php/routing

Add a cache mecanism

Open
#3 1 comment 0 reactions 1 assignee Claimed by @khalyomede View on GitHub
enhancement
Dominant language
PHP
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Description

Since this library relies on [nikic/fast-route](https://github.com/nikic/FastRoute), we can leverage the cache feature.

## Expected behavior

To be able to specify wether to enable caching route or not.

```php
use Folded\enableRouteCache;
use Folded\disableRouteCache;

enableRouteCache();
disableRouteCache();
```

It should be disabled by default.

And being able to specify in which file to store the cache.

```php
setRouteCacheFilePath(__DIR__ . "/cache/routes/routes.php");
```

## Actual behavior

No way to enable/disable route cache, nor a way to set the route cache file.

## Notes

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.