-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add support for caching with file extensions #152
Conversation
So the only issue I see here is when you specify a different file encoding in your image manipulations ( I think we could check for this though. We'd need to check the
|
Ah yes of course. Forgot about |
Thanks man! I'd help you but I'm out of time for this week. |
No worries. I just pushed up the changes to support that. |
|
||
if ($this->cacheWithFileExtensions) { | ||
$ext = isset($params['fm']) ? $params['fm'] : pathinfo($path)['extension']; | ||
$cachedPath .= '.'.$ext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this a single line?
$cachedPath .= isset($params['fm']) ? $params['fm'] : pathinfo($path)['extension'];
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely. Done.
This is looking great. Next question. Is this |
Sounds good to me! |
Thanks! |
Hey there.
I'd like to be able to add file extensions to the cached images so they can be served directly.
In our app (Statamic, in this case), we'll have an option to pre-generate the images and use this approach. Obviously we'd lose the dynamic URL based nature of Glide, but this would be a switch people could flick to increase performance.
On heavier sites, loading an image directly is considerably faster than bootstrapping the app.