You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the HTTP signature token from cache filename (getCachePath()) to prevent the regeneration of images between secured and unsecured requests.
This can be helpful in situations where you want to use secure image URLs, but you want to eagerly generate some common image variations using a server-side script. However, if it's server-side it's pointless to include the HTTP signature.
Something like this:
classController
{
publicfunctioncreateNewUser()
{
// Some new user logic$user = newUser();
// Create image manipulations for known, common sizes// Really this should be pushed offer to a queue/worker$glide->makeImage('img/users/'.$user->id, [
'w' => 500,
'h' => 500
]);
}
}
This will create the image manipulations right away, and will save them in the cache. Then, when that image is requested (/img/users/1.jpg?w=500&h=500) it will be ready right away.
This is an excellent way to help prevent server flooding.
The text was updated successfully, but these errors were encountered:
Remove the HTTP signature token from cache filename (
getCachePath()
) to prevent the regeneration of images between secured and unsecured requests.This can be helpful in situations where you want to use secure image URLs, but you want to eagerly generate some common image variations using a server-side script. However, if it's server-side it's pointless to include the HTTP signature.
Something like this:
This will create the image manipulations right away, and will save them in the cache. Then, when that image is requested (
/img/users/1.jpg?w=500&h=500
) it will be ready right away.This is an excellent way to help prevent server flooding.
The text was updated successfully, but these errors were encountered: