DMarby / picsum-photos

Lorem Ipsum... but for photos.
https://picsum.photos
MIT License
2.2k stars 152 forks source link

Missing Content-Length header #76

Closed creativecreatorormaybenot closed 1 year ago

creativecreatorormaybenot commented 3 years ago

First of all, I have to say that this repo is really awesome 🙌 Thanks for creating it!

What I am currently missing is the Content-Length header in the response headers. Usually, images specify this header, so that clients know the expected total sizes of the image. This is useful for showing loading indicators e.g.

Example

Say this image: https://portfolio.creativemaybeno.dev/assets/assets/avatar.png

This is an image in a simple web app I created, hosted via GitHub Pages. If you take a look at the network request when opening the image, you will see the following response header:

content-length: 93726

This means that the image has a size of 93726 bytes.

Documentation

You can find the documentation in MDN Web Docs: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length

DMarby commented 1 year ago

Hi,

Apologies for the late reply, but I'm not able to reproduce this, as far as I can tell content-length is being set correctly for the image responses. Please let me know if you are still seeing this, and if so, for what URLs.