-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Images not caching while using PWA #3174
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
if you import the images from within the javascript (similar to how you've imported the css) they will be precached for instance, you could put your import add from '../assets/add.jpg'
const SausageComponent = () =>
<img src={add} /> |
or indeed: import add from '../assets/add.jpg'
const SausageComponent = () =>
<Parallax.Layer
style={{
backgroundImage: `url(${add})`
}}
/> |
Ok let me check |
Also my question is can't we do it by keeping it in |
Great it works now, I did put it in the |
Also can it |
If you follow my example in that issue it'll work fine, you need to use require not import to grab arrays of images. |
Yep it works. Sorry in that issue someone said it doesn't work so I didn't test 😂 |
I'll close this as resolved then. 😄 |
Can you answer this ❔ |
The Having them in |
The website is here & the code is here
I have put my images in
public/assets
folder but don't know how to configureservice-worker
tocache
images when there is no internet connectionI did read the docs & from what I understood it caches automatically I guess 🤔, but not sure
So when I visit the above website offline, it shows only text & no images are served while offline 😢
Please take a look
The text was updated successfully, but these errors were encountered: