PHPackages                             h-space/api-cacher-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. h-space/api-cacher-bundle

ActiveLibrary[Caching](/categories/caching)

h-space/api-cacher-bundle
=========================

Api requests smart cacher for perfomance optimization

16PHP

Since Mar 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/nikos90/ApiCacherBundle)[ Packagist](https://packagist.org/packages/h-space/api-cacher-bundle)[ RSS](/packages/h-space-api-cacher-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ApiCacher Bundle
================

[](#apicacher-bundle)

ApiCacher is a symfony2 caching system for data provided by API endpoints. It is used for optimising the performance of a website that uses external API services for data.

### Installation

[](#installation)

Composer:

```
"require": {
        "h-space/api-cacher-bundle": "dev-master"
    }
```

```
$ composer install
```

### Usage

[](#usage)

Include the library:

```
    use HSpace\Bundle\ApiCacherBundle\Library\ApiCacher;
```

Initialize class:

```
     $cacher = new ApiCacher();
```

Single request:

```
     $url = 'https://example.com/api/endpoint?api_key=YOUR_API_KEY';
     $fields = null; // if post request, fields is an array with post data else null
     $json_decode = true;
     $rebuild_cache = true; // rebuild cache at the the end of the proccess, more details below
     $response = $cacher->request($url,$fields,$json_decode,$rebuild_cache);
```

Multi Requests:

```
     $url_one = 'https://example.com/api/endpoint?api_key=YOUR_API_KEY';
     $url_two = 'https://example.com/api/endpoint_two?api_key=YOUR_API_KEY';
     $fields = null; // if post request, fields is an array with post data else null
     $json_decode = true;
     $rebuild_cache = true; // rebuild cache at the the end of the proccess, more details below
     $cacher->request_multi($url_one,$fields,$json_decode,$rebuild_cache);
     $cacher->request_multi($url_two,$fields,$json_decode,$rebuild_cache);
     $cacher->execute($json_decode);
     $responses = $cacher->multi_output();

 //Accessing the responses
    $url_one_response = $responses[$url_one];
    $url_two_response = $responses[$url_two];
```

Erase Cache Listener

> To erase all cache files include `eraseCache=true` $\_GET parameter in your request.

> Example:

Enable Auto Refreshing Of Cache Files
=====================================

[](#enable-auto-refreshing-of-cache-files)

Import the resource on your `app/config/routing.yml`

```
_hspace:
   resource: "@HSpaceApiCacherBundle/Resources/config/routing.yml"
```

Call the function at your end of your class/controller

```
        $route = $this->generateUrl('hspace_reload_cache',array(), true); // for controller usage, you have to generate the  url if you are outside of controller
        $cacher->teardown($route);

```

### Version

[](#version)

1.0.0

License
-------

[](#license)

MIT

**Free Software, Hell Yeah!**

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/31916dbf513309cb6fbe0fd4e7bb754ffac7f4e9c6819f2c66dd83d5cb249b44?d=identicon)[nikos\_90](/maintainers/nikos_90)

---

Top Contributors

[![nikos90](https://avatars.githubusercontent.com/u/5305637?v=4)](https://github.com/nikos90 "nikos90 (1 commits)")

### Embed Badge

![Health badge](/badges/h-space-api-cacher-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/h-space-api-cacher-bundle/health.svg)](https://phpackages.com/packages/h-space-api-cacher-bundle)
```

###  Alternatives

[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[ichhabrecht/intcache

Turn uncachable page objects into cacheable links

193.9k](/packages/ichhabrecht-intcache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
