sorenpeter / twtAgent

A php wrapper for twtxt.txt for logging User Agent request
MIT License
1 stars 1 forks source link

Implement `If-Modified-Since` support #1

Open eapl-gemugami opened 12 hours ago

eapl-gemugami commented 12 hours ago

To be compatible with Clients only downloading content if it's newer, this Agent needs to support If-Modified-Since header, as Web servers like Nginx or Apache do.

Symptom

The Agent doesn't support If-Modified-Since header in the request, returning the whole content anyway with HTTP code 200.

We could replicate it following this guide: Download File only when Changed using wget/curl

wget --debug -N https://darch.dk/twtAgent.php

Expected

It should return the Last-Modified header with the actual file date and a 304 Not modified status if file is older.

eapl-gemugami commented 12 hours ago

I could help with this during the week, if it's something useful.

sorenpeter commented 12 hours ago

Yes, having a quicker refresh would be nice. And would great to not spam other servers with requests if nothing is new.

I have also notices that some feeds are automatic updated without pressing /refresh - It that feature you made in the orignial twtxt-php, because I don't think it worked like that in the beginning?

(EDIT: I just notice that this is on twtAgent and not on Timeline)

eapl-gemugami commented 4 hours ago

Yes, having a quicker refresh would be nice. And would great to not spam other servers with requests if nothing is new.

Cool :D

I have also notices that some feeds are automatic updated without pressing /refresh - It that feature you made in the orignial twtxt-php, because I don't think it worked like that in the beginning?

It wasn't me! I thought it was you :)