Does MicroPython support URLs with fragment identifiers?
https://en.wikipedia.org/wiki/Fragment_identifier
I'm writing a small web server that polls a JPEG image that constantly changes (e.g.. like a live webcam feed). It's currently working by adding an unique cache-busting query parameter to the URL. Like this:
newImage.src = "image.jpg?t=" + new Date().getTime();
However, I'd like to serve the images with the header Cache-control: max-age=0, must-revalidate, and add an unique memcache-busting fragment identifier to the URL instead, such as:
newImage.src = "image.jpg#" + new Date().getTime();
But that doesn't work. Any suggestions?
Fragment identifier
-
- Posts: 463
- Joined: Wed Apr 08, 2015 5:19 am
Re: Fragment identifier
Which web server framework, if any, are you using? And how do you request the image?
Re: Fragment identifier
The fragment identifier is never sent to the web server, it can only be visible on the browser side.
Re: Fragment identifier
@SpotlightKid, I'm not using any framework. I just wrote my own WSGI using the MicroPython API. I request the image by polling it from the browser via JavaScript.
@deshipu, thank you for the clarification. That makes sense now.
@deshipu, thank you for the clarification. That makes sense now.