Announcements

Help Wizard

Step 1

NEXT STEP

Dynamic CDN domains for images?

Dynamic CDN domains for images?

Gooday,

 

I would like to ask if the CDN's where the images are hosted are always the same or change overtime?

 

I'm using NextJS and need to whitelist these domains for my images.

This is what I'm trying to do: https://nextjs.org/docs/api-reference/next/image#domains

 

So far i've seen these when checking the network tab:

 

    domains: [
      "i.scdn.co",
      "t.scdn.co",
      "newjams-images.scdn.co",
      "dailymix-images.scdn.co",
      "seed-mix-image.spotifycdn.com",
      "charts-images.scdn.co",
      "daily-mix.scdn.co",
      "mixed-media-images.spotifycdn.com",
    ]

If they never change could you provide me with a list all used domains for the images? Or put it in the documentation?

 

This would help with image optimization and security in apps.

 

Thanks.

 

 

 

Reply
2 Replies

I also found scdn.co

I suggest that you take advantage of remotePatterns , as it allows for the use of wildcard patterns.

 

module.exports = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "**.scdn.co",
      },
      {
        protocol: "https",
        hostname: "**.spotifycdn.com",
      },
    ],
  },

This will solve all the image related issues.

 

Suggested posts