[xep-support] Re: How often does XEP.BAT use my graphic-URL?

From: Kirch Fritz <Friedrich.Kirch_at_ADDRESS_REMOVED>
Date: Wed Aug 12 2020 - 00:41:48 PDT

Hello Alexey,

we were able to set the "Expires:" header

[cid:image001.png@01D6708B.12CB3280]

But with no success.
XEP continues to make 3 GET-requests to the media-repository.
Any further ideas?

Fritz
Von: Xep-support <xep-support-bounces@renderx.com> Im Auftrag von Alexey Medvedev
Gesendet: Montag, 10. August 2020 16:15
An: xep-support@renderx.com
Betreff: [xep-support] Re: How often does XEP.BAT use my graphic-URL?

Hello Fritz,
I cannot see any "Expires:" header

That's precisely the reason why XEP makes multiple requests.

I've set up simple file sharing via "python -m http.server" and inspected XEP's behavior with your fo but referring an image shared via python.

XEP successfully cashes the image in memory while accessing it for the first time, but as there is no "Expires" header expiration date defaults to 0 which means the resource expires immediately.

When XEP needs the image for the second time it can't simply use the data from cache as it's expired, so it sends a request, but set's "If-Modified-Since" header. But pythons simple http.servers doesn't care about If-Modified-Since and simply sends the image again. XEP checks modification date and as it's the same as cashed data's XEP actually uses cashed data!

Actually starting from Python 3.7 http.server supports If-Modified-Since. So I've updated python and now http.server returns "304 Not Modified" instead of sending "200 OK" and image once again.

python 3.6.5

[cid:image006.jpg@01D6708C.CBC201F0]

python 3.8.5

[cid:image007.jpg@01D6708C.CBC201F0]

Therefore the solution for your issue is to make your server set "Expires" header.

--
Regards,
Alexey Medvedev
RenderX
---
www.renderx.com<http://www.renderx.com>



_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html

image001.png
image006.jpg
image007.jpg
Received on Wed Aug 12 00:41:52 2020

This archive was generated by hypermail 2.1.8 : Wed Aug 12 2020 - 00:42:04 PDT