#Images Loading Slowly

4 messages · Page 1 of 1 (latest)

urban tangle
#

Hey support team!

I notice my payload CMS sends my images a little delayed when i load my website.

Is there things I can do to fix this like making changes to my <Image ... /> tags?
Or is there a better way to load an image than using the getPayload utility function?

Is the current latency expected? If so then the advised step to be would bring in a skeleton loader right?

Here is the link to my site so you can see what I mean by that
https://vorgeas-media.vercel.app/

lavish pendantBOT
urban tangle
#

cc @quick locust

urban tangle
#

I ended up using this block of code to optimize my image usage:

upload: {
    // Upload to the public/media directory in Next.js making them publicly accessible even outside of Payload
    staticDir: path.resolve(dirname, '../../public/media'),
    adminThumbnail: 'thumbnail',
    focalPoint: true,
    imageSizes: [
      {
        name: 'thumbnail',
        width: 300,
      },
      {
        name: 'square',
        width: 500,
        height: 500,
      },
      {
        name: 'small',
        width: 600,
      },
      {
        name: 'medium',
        width: 900,
      },
      {
        name: 'large',
        width: 1400,
      },
      {
        name: 'xlarge',
        width: 1920,
      },
      {
        name: 'og',
        width: 1200,
        height: 630,
        crop: 'center',
      },
    ],
  },