-
Notifications
You must be signed in to change notification settings - Fork 199
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
Browser not caching generated images (no 304) #185
Comments
@InfinityWebMe try passing in your request to your response factory as seen here for laravel laravel example: use League\Glide\ServerFactory;
use League\Glide\Responses\LaravelResponseFactory;
$server = ServerFactory::create([
'response' => new LaravelResponseFactory(app('request'))
]); or for symfony use League\Glide\ServerFactory;
use League\Glide\Responses\SymfonyResponseFactory;
$server = ServerFactory::create([
'response' => new SymfonyResponseFactory($app['request']),
]); That "should" do it .... maybe haha. |
@cdowdy |
It's not done by default in the Even if you're not using a framework, I'd recommend installing the HttpFoundation package. This allows you to optionally pass in a request object, which will be used to figure out the Completely untested, this would look something like this: use League\Glide\Responses\SymfonyResponseFactory;
use League\Glide\ServerFactory;
use Symfony\Component\HttpFoundation\Request;
// Setup Glide server
$server = ServerFactory::create([
'source' => 'path/to/source/folder',
'cache' => 'path/to/cache/folder',
'response' => new SymfonyResponseFactory(
Request::createFromGlobals()
)
]);
// Output image
$server->getImageResponse('users/1.jpg', ['w' => 300, 'h' => 400])->send(); Remember to install the composer require league/glide-symfony And for what it's worth, this will be baked into version 2.0, since that will copy with HttpFoundation (and a PSR-7) implementation by default. Good luck! |
Hello,
in reference at this issue : #20
The issue seems to be in v1 ? I don't found the header if-modified-since.
The text was updated successfully, but these errors were encountered: