Closed nilsnolde closed 4 years ago
Update: Gitlab doesn't send a last-modified
header :roll_eyes: or anything related. So maybe the only option here would be to ask for the last commit and take the date out of there. A tiny little bit slower than for other providers, but still okish..
Hi @nilsnolde , thanks again for your help.
About the caching, checking the document edits sounds like a great idea. Although as an intermediate step, would this simpler approach be possible?
Maybe this is something you're already doing.
Thanks!!
Not even that much simpler I guess. Requesting a HEAD is not the more complicated thing to do IMO.
I think most of the work is researching how to best cache in WP, i.e. which directory to put them in or how (if) to flag that as cache, so it survives plugin & WP updates. Granted, that's not more than an hour. The rest is pretty straight-forward. I'd expect a day for this approx.
I'll take a look into this in a while, 1-2 months max. I don't consider it critical for most blogs. Can of course be sponsored money-wise, then I'd find time quicker;)
Thanks @nilsnolde, sure I'd be happy to pitch in $$. Do you have a donation link or anything?
btw, I found a wordpress plugin that had a caching system that seemed to work well, it might be worth looking into for ideas. https://github.com/anytizer/hosted-content-importer.wp
Yeah and there you got me.. I should set up smth like a donation link for us before slinging around things like that :wink: Thanks for the offer and the link. I'll dig in when I find the time.
Quick shoutout @eblabs: #19 and @danilopinotti will implement static caching, merging and releasing soon. Wanted to let you know already, I'm kinda excited about this :smile: And sorry for the long wait
Merged and v1.1.0 released to plugin repo :champagne:
Thanks so much for the update @nilsnolde !! Really appreciate all your effort on this super handy plugin 👍
To avoid requesting the post from any platform even if nothing has changed since the last pull, the plugin should cache the posts. Use a HEAD request for this.
The logic to cache the post could be:
owner/org|repo|postname|datestring
(or find a delimiter which can't be part of the resource URL)last-modified
response header is newer than extracted date string: