Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

How to stop duplication of assets with identical contents #43

Open
jay-to-the-dee opened this issue Feb 26, 2019 · 0 comments
Open

How to stop duplication of assets with identical contents #43

jay-to-the-dee opened this issue Feb 26, 2019 · 0 comments

Comments

@jay-to-the-dee
Copy link

jay-to-the-dee commented Feb 26, 2019

About me

  • My name: Jonathan Dilks
  • I've used Netlify: quite a while now

My question in a little more detail

I use GTmetrix to measure my website's performance regularly. It makes suggestions as to optimisations.

One issue I'm currently getting highlighted by the tool is "Serve resources from a consistent URL - The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL"

I've disabled and re-enabled Netlify asset optimisation, as well as changing my jekyll-assets config to no luck. It seems that <img src> asset references are always served with the CloudFront domain, whilst <link href> references are always served off the Netlify origin domain.

Here are the extracts of the Netlify produced source code; where simpler-bulb-primary-dark.svg is the exact same resource unnecessarily duplicated by two different HTTP requests:
<link rel="preload" as="image" href="/assets/simpler-bulb-primary-dark.svg"> & <img width="250" height="250" alt="Smart Helping Hands logo" src="https://d33wubrfki0l68.cloudfront.net/abdba9c31570febda716627613edee7c1b7b9338/057de/assets/simpler-bulb-primary-dark.svg" integrity="sha256-5z1P4yeVXgVsxe/bywcAGcessUwED2e8NgmMsxRhKBo=" crossorigin="anonymous">'

Is this a bug in Netlify, or is there a way of fixing this behaviour?

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

No branches or pull requests

1 participant