Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Dynamic CDN domains for images?

Solved!

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

Accepted Solutions
Marked as solution

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.

 

View solution in original post

2 Replies

I also found scdn.co

Marked as solution

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