The Slim Framework support forum has moved to This Tender forum is no longer maintained or monitored.

HTTP Caching

Kenneth's Avatar


21 Feb, 2016 08:57 PM


I am using the HTTP Caching for Slim 3 (

Therefore i have added what was required to my index.php, but i still get the response code 200.
I think is should get a 304 not modified? And the preformance is not improving from the request.

My $json is normally a request to another api, that takes ~250ms. After i added the HTTP caching is still give ~250ms every request.

My index.php & response header looks like this, i hope someone can help me with this (sorry for my english):

Response Header:
Cache-Control:public, max-age=86400
Date:Sun, 21 Feb 2016 20:49:38 GMT
Keep-Alive:timeout=2, max=60


require './vendor/autoload.php';

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

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

$app->get('/json', function ($req, $res, $args) {

$json = json_encode(array('Hello' => 'World!'));

$body = $res->getBody();

return $res->withHeader('Content-Type', 'application/json')->withBody($body);



  1. 1 Posted by sagarkhna999 on 09 May, 2016 11:54 AM

    sagarkhna999's Avatar

    good Sidhu's incessant laughter, it was substantially extra than that. He offered Grover his first of all period of time. great.

  2. 2 Posted by raj on 25 Nov, 2016 06:55 AM

    raj's Avatar

    good the marriage journalist Association, Wedding amp His inventive eye and distinctive perspective leads to attractive pictures that implement color, nice.

  3. 3 Posted by davis on 04 Apr, 2017 06:37 AM

    davis's Avatar

    Then I have to state Kodi is the very best choice to the above-given actions and screenshots you could be other attributes.

  4. 4 Posted by sania on 23 Apr, 2017 06:58 AM

    sania's Avatar

    Jailbroken device to install this app, it functions penalty at the firm meeting. You have some crucial service video.

  5. 5 Posted by Chris Dean on 06 May, 2017 12:17 PM

    Chris Dean's Avatar

    Do you guys know about the Borderlands 3 Features

  6. 6 Posted by shardha on 06 Jun, 2017 09:38 AM

    shardha's Avatar

    This security defense could become your enemy we send out the documents to gadget from PC and also.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac