Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove client-side cache for NFT images #284

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

mcintyre94
Copy link
Collaborator

@mcintyre94 mcintyre94 commented Aug 17, 2023

This PR fixes the bug where some NFT images are not showing in Explorer

I think this is caused by a change in SWR affecting the useCachedImage hook, since I bumped the version of SWR in #281

But I don't think we need this caching layer on the client, we're only showing the image once and NFT images are (hopefully!) served by CDNs with their own appropriate caching behaviour. I don't think the indirection is giving us any benefit. So I've removed the useCachedImage hook and we now just use the image URL directly to display the image. This resolves the issue because the image URLs themselves are working correctly.

Links from the issue:

https://explorer-26hek7xby-solana-labs.vercel.app/address/6adQxeQ9BrakM4VnqwQnvfXRGFMt9M2JivJ3DVoWawGa
Screenshot 2023-08-17 at 15 07 16

https://explorer-26hek7xby-solana-labs.vercel.app/address/BNqnMRoW6tTh9qn3q1XFe9ksf7bnX1s2GShdShuk7sZR/metadata?cluster=devnet
Screenshot 2023-08-17 at 15 07 59

Fixes #283

@vercel
Copy link

vercel bot commented Aug 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 17, 2023 2:10pm

@solana-labs solana-labs deleted a comment from vercel bot Aug 17, 2023
Copy link
Collaborator

@ngundotra ngundotra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Clean change

@mcintyre94 mcintyre94 merged commit 6930cce into solana-labs:master Aug 18, 2023
3 checks passed
@mcintyre94 mcintyre94 deleted the nft-cache-fix branch August 18, 2023 09:05
@philetos
Copy link

nice work guys!

nicezic added a commit to gh-waybit/explorer that referenced this pull request Aug 22, 2023
Remove client-side cache for NFT images (solana-labs#284)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Metaplex NFT Images No Longer Displaying
3 participants