Netlify Large Media + Netlify CMS Uploads (cloudfront?)

Need some help here… I configured my project to utilize Netlify’s Large Media storage, as well as add Netlify CMS features. Large Media seems to be working–files are listed within the project’s Large Media tab and show how many image transformations have occurred.

My problem is when I upload an image using Netlify CMS I can see the image within the CMS’s preview, but when it uploads live to the site it does not show.

Link to the post here

When inspecting the webpage of CMS’s entry I see the following link:
cloudfront.net/<some/hash>/images/uploads/test_image.png

The image is within the website, but points to the wrong location, I think? The correct location is here: /images/uploads/test_image.png

What can I do, or (re)configure, to solve this? Below is the CMS config.yml file for my Hugo site:

backend:
  name: git-gateway
  branch: master # Branch to update (optional; defaults to master)

use_large_media_transforms_in_media_library: true
site_url: https://enjoi.dev
# logo_url: https://enjoi.dev/images/logo.png
show_preview_links: true
publish_mode: editorial_workflow
media_folder: "static/images/uploads" # Media files will be stored in the repo under static/images/uploads
public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads

Hi, @lafcadio. The cloudfront URLs are only used by Netlify when asset optimization is enabled. However, Large Media and asset optimization are incompatible. This is found in our documentation here:

Quoting:

  • Netlify Large Media is not compatible with Netlify’s built-in asset optimization. If you enable Netlify Large Media, you need to select Disable asset optimization in Site settings > Build & deploy > Post processing > Asset optimization .

If you disabled the asset optimization it should resolve the issue. If there are other questions or concerns, please let us know.

Hi Luke. Thanks for the help! I didn’t see this mention of it in the docs initially. I must have skimmed right by it.

1 Like