Image not cached in webview?

*Problem description:
image files stored in a repl seem to be reloaded every time a html-js-css repl is run

Expected behavior:
image files are cached for faster reload

Actual behavior:
image file loaded from server when I press the ‘run’ button

Steps to reproduce:

  1. create an html-js-css repl.
  2. upload a heavy image file (like 1.8MB spritesheet)
  3. write js code to display the image
  4. run the repl

Bug appears at this link:


Welcome to the community!

Every time I run an HTML/JS/CSS Repl, it refreshes the cache when you hit run. Please note two important things:

  1. It only does this on the webview section of the code editor. Opening the website in a new tab would prevent the cache refreshing (unless you used Ctrl F5 when refreshing).
  2. This is a good thing. When I’m making websites, I may make major changes to the site and I need the cache refreshed so that it reflects those changes. You can’t really force a cache refresh on the webview in the code editor, so doing this automatically is good.

Please also note that since the webview tab in the code editor is embedded in Replit’s website (rather than being freestanding), it should be slower, as it’s probably just an iframe.

In conclusion, I think that this is not a bug but actually a necessary feature without which coding would be more difficult, as you would have to either use a new tab in your browser or else refresh the code editor page to refresh the webview.

  • Feature
  • Bug

0 voters

1 Like