Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware CacheRequests does not exist #19

Open
basdog22 opened this issue Nov 19, 2015 · 8 comments
Open

Middleware CacheRequests does not exist #19

basdog22 opened this issue Nov 19, 2015 · 8 comments

Comments

@basdog22
Copy link

Hi Barry!
Just installed with composer:
"barryvdh/laravel-httpcache": "0.2.x@dev"

and the middleware 'Barryvdh\HttpCache\Middleware\CacheRequests' does not exist.

Am i missing something?

@basdog22
Copy link
Author

Nevermind i set up one by myself.
Thanks for reading :)

@argb
Copy link

argb commented Nov 19, 2015

I found the same problem too,does this package still be maintained?

@argb
Copy link

argb commented Nov 19, 2015

Maybe not a problem,found this below:

public function boot()
{
/** @var \Barryvdh\StackMiddleware\StackMiddleware $stack */
$stack = app('Barryvdh\StackMiddleware\StackMiddleware');

    $stack->bind(
      'Barryvdh\HttpCache\Middleware\CacheRequests',
      'Symfony\Component\HttpKernel\HttpCache\HttpCache',
      [
        $this->app['http_cache.store'],
        $this->app['http_cache.esi'],
        $this->app['http_cache.options']
      ]
    );
}

@barryvdh
Copy link
Owner

Did you add the service provider?

@basdog22
Copy link
Author

Yes. I add SP and also added the middleware to the kernel but the httpcache did not work. No files in the storage dir or age value in headers.

I created a middleware that takes the response with $next($request) and then i added ->setTtl to it. Now it is ok

Info: My dir structure is not the default laravel 5

@hamony
Copy link

hamony commented May 27, 2016

I got the same issue, it seems there isn't CacheRequests in the Middleware folder. I'm using laravel 5.2 how can I fix this?

@hamony
Copy link

hamony commented May 29, 2016

Never mind, my failure setting up.

@ctf0
Copy link

ctf0 commented Aug 19, 2017

#41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants