Open navClose nav

Storing Uploads With Netlify Large Media

Forestry can integrate with Netlify Large Media for storing your uploads. Netlify Large Media is a Git LFS target, enabling you to seamlessly incorporate large media files in your repository without the performance penalty that this usually requires.

For more information on Git LFS, view our blog post: Versioning Large Files with Git LFS.

Getting Started With Netlify Large Media

Before setting up Netlify Large Media on your site, ensure you have successfully deployed your site to Netlify. From there, you will want to clone your repository to your local machine to set up Netlify Large Media via Netlify’s CLI tool. Follow the steps outlined in Netlify’s Large Media Documentation to complete the set up.

Connecting Large Media to Forestry

Once you have successfully configured Netlify Large Media on your repository, you will need to configure your media library on Forestry to use it.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2019/05/media-settings-netlify.png

Go to Settings > Media on your Forestry site, and change your Media Storage Provider setting to Netlify Large Media.

Configuration

Your upload directory should remain the same, so re-enter the upload directory you were using previously. The public path should be the URL to the media file on your Netlify site. This will be your original public path prepended with the URL to your Netlify site.

Beneath the path fields, click the Connect to Netlify button to connect Forestry to Netlify in order to authenticate the media library.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2019/05/media-settings-netlify-complete.png

Once you have successfully connected to Netlify, you will see the Connected message on the settings page.

Usage with Instant Previews

If you’re using Instant Previews with Netlify Large Media, you will need to skip the LFS file download when your preview runs. To do this, add an environment variable to your instant preview environment with the key of GIT_LFS_SKIP_SMUDGE and a value of 1.

https://res.cloudinary.com/forestry-io/image/fetch/c_limit,dpr_auto,f_auto,q_80,w_640/https://forestry.io/uploads/2019/05/instant-preview-skip-smudge.png

Using Netlify’s Image Transformations

Using Netlify Large Media, you can create image transformations by appending parameters to the image URL. For documentation and examples, check out Netlify’s image transformation docs.


Last updated on May 2, 2019