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

Allow for eager manipulating of images #72

Closed
reinink opened this issue Jun 15, 2015 · 1 comment
Closed

Allow for eager manipulating of images #72

reinink opened this issue Jun 15, 2015 · 1 comment

Comments

@reinink
Copy link
Contributor

reinink commented Jun 15, 2015

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:

class Controller
{
    public function createNewUser()
    {
        // Some new user logic
        $user = new User();

        // 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.

@reinink
Copy link
Contributor Author

reinink commented Dec 20, 2015

This is done in the upcoming 1.x release.

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

No branches or pull requests

1 participant