timhagn / gatsby-background-image

Lazy-loading React (multi)background-image component with optional support for the blur-up effect.
MIT License
253 stars 49 forks source link

Issue with displaying placeholder forever, when image loads from cache #180

Open spake-xx opened 1 year ago

spake-xx commented 1 year ago

Description

Hello! I have issue with forever displaying placeholder instead image, when image got loaded from browser cache. It's making the plugin unusable. Is it actual bug or does any workaround exist?

Steps to reproduce

Just set http requests to cache all static images, build and deploy to production. First time, when loads from server, image will sucessfully load, but later, when loading from the cache, there will be placeholder instead image visible.

Expected result

When loading image from the cache, placeholder should disappear and loaded image should be visible.

Actual result

When image loads from the cache, placeholder won't be replaced by loaded image. image

Environment

System: OS: Windows 10 10.0.19045 CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz Binaries: Node: 18.13.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD Languages: Python: 3.10.0 Browsers: Chrome: 109.0.5414.75 Edge: Spartan (44.19041.1266.0), Chromium (109.0.1518.55) npmPackages: gatsby: ^5.4.0 => 5.4.2 gatsby-background-image: ^1.6.0 => 1.6.0 gatsby-plugin-htaccess: ^1.4.0 => 1.4.0 gatsby-plugin-image: ^3.4.0 => 3.4.0 gatsby-plugin-sass: ^6.4.0 => 6.4.0 gatsby-plugin-sharp: ^5.4.0 => 5.4.0 gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.30 => 1.1.30 gatsby-source-filesystem: ^5.4.0 => 5.4.0 gatsby-transformer-sharp: ^5.4.0 => 5.4.0

dmorda commented 1 year ago

I'm experiencing the same issue. Not sure if this plugin is supported any longer as the last commit was from Jul 2022. Have you found any alternative solutions short of rolling your own?