0

I have a route :

$app->get('/api/home',['\App\Controllers\HomepageController','getAllCards']);

In my App.php file, I have registered the service provider as:

$dependencies = [ 'cache' => function(Container $container) {
                   return new \Slim\HttpCache\CacheProvider();
                   },
                ];

In my index.php file:

$app = new \App\App;
$container = $app->getContainer();
$app->add(new \Slim\HttpCache\Cache('public', 86400));

How do I add the cache with headers like CacheControl,Etag,expires,etc in the above route?

lotfio
  • 1,916
  • 2
  • 18
  • 34
Ayush28
  • 359
  • 3
  • 18
  • Have a look at [this](https://www.slimframework.com/docs/features/caching.html) page. – Jeroen Heier Jul 30 '17 at 14:35
  • I already read the documentation and implied as given in the docs. When there was no change in the header at client-side, I turned up to SO @JeroenHeier – Ayush28 Jul 30 '17 at 14:39

0 Answers0