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

Alexey Medvedev amedvedev at renderx.com
Mon Aug 10 07:14:50 PDT 2020


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

python 3.8.5


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

-- 

Regards,
Alexey Medvedev
RenderX
---
www.renderx.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20200810/8fcf7d61/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aghjkghcineahcdo.jpg
Type: image/jpeg
Size: 183925 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20200810/8fcf7d61/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kddghkeghhpajech.jpg
Type: image/jpeg
Size: 175414 bytes
Desc: not available
URL: <http://lists.renderx.com/pipermail/xep-support/attachments/20200810/8fcf7d61/attachment-0003.jpg>


More information about the Xep-support mailing list