#dev 2023-07-17

2023-07-17 UTC
angelo, pharalia, tei_ and Soni joined the channel
#
[manton]
gRegor: The Ruby gem. Actually looks like I’m on an older version, but quickly skimming the commit history I don’t think anything with this has changed. An exception is being thrown when using `URI`… e.g. `URI("mailto:asdfasdf")` will fail. Fix seems straightforward to catch the error and just ignore those URLs, but I haven’t looked closely.
#
[manton]
I’ll test and do a pull request when I have time.
#
[jgarber]
That’s proooooobably happening while trying to absolute-ize URLs…?
#
Loqi
[preview] [Shaun Harrison] What is the correct way to validate a user delete request in ActivityPub?Mastodon signs it with the key of the user being deleted, and when you request the key, it returns 410 so it's not really clear to me how you'd validate that signature.#activity...
btrem and vladimyr joined the channel
#
epoch
I read "AS2" and thought "Autonomous System 2?" then remembered what I was reading and realized it meant "Activity Streams 2"
tei_ and tei_1 joined the channel
#
aaronpk
This is how I've been handling it
#
aaronpk
if I don't have the key cached it's because I've never seen the user so I don't care about the delete
#
sknebel
that seems reasonable
#
aaronpk
It does mean you have to store all keys, but that is also a good idea anyway
AramZS, [Jo], shoesNsocks and btrem joined the channel
#
[tantek]
speaking of caching, I'm curious what's the latest "best practice" for caching webmention endpoints, either from a particular URL or for a whole domain? Like I believe Bridgy does some degree of caching / inference of wm endpoints it has discovered, and AFAIK such behavior is beyond (outside the bounds of) the Webmention spec
#
[tantek]
I am particularly curious in the context of "large" systems that may want to "turn on" sending Webmentions, but would require them to do potentially LOTS of Webmention discovery traffic, perhaps repeatedly on the same URLs / domains for heavily "shared" links/domains
#
[tantek]
Two part question really: what are current Webmention senders doing in terms of caching discovered wm endpoints (either page or domain level caching or both) ?
#
[tantek]
and second: is there a way to indicate in your Webmention link rel that that discovery may be cached by the discoverer for some amount of time, like a week or a month?
#
[tantek]
and 2a: is there a way to indicate in your Webmention link rel that that discovery may also be re-used for OTHER permalinks (or your entire domain), and cached as such, for some amount of time?
#
[tantek]
^ obviously both of these questions could be applied to link rel discovery methods in general, however, Webmention is a good specific example of link discovery which has numerous implementations of varying scales that we can learn from
superkuh joined the channel
#
[tantek]
thoughts on whether / how to generalize caching link rel endpoint discovery in general? e.g. for Micropub, IndieAuth, etc.?
#
aaronpk
would it need to be different than indicating the caching of the rest of the page?
#
aaronpk
e.g. use existing http cache headers
#
[tantek]
yes absolutely. you might edit the contents of a blog post in minutes certainly over hours. whereas it's very unlikely the wm endpoint for that blog post will change in minutes or hours.
#
[tantek]
or even days/weeks/months
#
aaronpk
alternate question, since there are a ton of other link rels, has anyone proposed a caching mechanism for any of the others?
#
aaronpk
e.g. favicon or app manifest and such
#
btrem
Wouldn't you again use http cache headers?
#
aaronpk
can http cache headers target specific parts of the page?
#
[tantek]
btrem ^ already answered, caching behavior for a page vs links a page points to are different things
#
[tantek]
aaonpk, not AFAIK
#
aaronpk
me either, but i am always surprised when i look up the latest state of http stuff
#
[tantek]
hah true
#
[tantek]
aaronpk, it feels more like a need for an HTML attribute on link/a, that indicates a cache directive on the rel-ness of that link/a
#
aaronpk
that was my first thought
#
aaronpk
i'm curious if anyone has done that for other link values
#
[tantek]
it's something that overlaps both HTML and HTTP
#
[tantek]
aaronpk, I don't think anyone has done it for any other link rel discovery values in particular
#
[tantek]
some rel values, like "stylesheet" the consuming code has always already retrieved the source HTML, so there's no need for such a caching directive
#
[tantek]
other rel values, like most XFN values (i.e. all but 'me'), use-cases access them infrequently enough that no caching is needed
#
btrem
For favicon, why wouldn't you rely on the cache headers returned with example.org/favicon.ico? Same for manifest.json?
#
aaronpk
because those cache headers talk about the *content* of the icon, but we're talking about caching the location of the icon
#
[tantek]
favicon doesn't use rel discovery so it's inapplicable to this topic
#
aaronpk
well there's the new favicon link rels
#
aaronpk
that don't use the hardcoded favicon.ico path
#
[tantek]
if you mean rel="icon" sure
#
[tantek]
I wouldn't conflate that with a particular use-case "favorite" which is not even a dominant use-case
#
btrem
If the location changes, then http status codes 30x would be appropriate, no?
#
aaronpk
btrem: that might work for icons on the same site, but doesn't work for webmention endpoints
#
btrem
I only use favicon.ico as an example.
#
[tantek]
again, this is about the link rel discovery step, not the retrieval step
#
aaronpk
e.g. if someone's webmention endpoint is webmention.io, i'm not going to start returning a 301 redirect on that endpoint 😂
#
[tantek]
step 1 retrieve HTML, step 2 link rel discovery in that HTML to find a URL, step 3 process that URL. we are talking about step 2. http status codes, cache headers are about step 3
#
[tantek]
^ btrem
#
[tantek]
this is about caching the result of steps 1 & 2 so that in the future you can skip those steps and jump straight to step 3
#
[tantek]
and http status codes, cache headers while helpful for step 1, are inapplicable to step 2 because of what I wrote to aaronpk above https://chat.indieweb.org/dev/2023-07-17#t1689613045880400
#
btrem
So the question is what happens when the page changes its endpoint. That seems like the same thing as when the page changes its content.
#
Loqi
[preview] [[tantek]] yes absolutely. you might edit the contents of a blog post in minutes certainly over hours. whereas it's very unlikely the wm endpoint for that blog post will change in minutes or hours.
#
aaronpk
btrem: that was my first question, which tantek gave a good answer to there ^
#
[tantek]
while "technically" it's the same thing, bytes in the page change, in practice no it's not the same thing
#
btrem
If your page changes in minutes, and you expect a ua to retrieve a new copy (using e.g. cache-control: max-age: 120 etc.), is there a large cost to looking at the rel attributes again?
#
aaronpk
no this is about someone finding the webmention endpoint and wanting to cache it, e.g. the bridgy issue linked previously
#
aaronpk
the consumer of the webmention link rel doesn't care about the rest of the content of the page
#
btrem
I see. So the problem is how does an author control the cache for wm when using a third-party wm endpoint (like webmenion.io)?
#
aaronpk
third party endpoints is probably the 80% problem, but it's not exclusive to that
#
aaronpk
like you can just change your own webmention endpoint URL within your own first party tooling whenever you want
#
[tantek]
btrem, see my steps 1,2,3 above. this is about step 2
#
[tantek]
"your page changes in minutes, and you expect a ua to retrieve a new copy" is about step 1
#
sknebel
also "HTTP caching" has very limited meaning for API endpoints
#
sknebel
like a WM endpoint
#
sknebel
there is no way for an endpoint to signal itself "please check if I'm still the right thing to use every X <time>"
#
[tantek]
also I don't believe you can meaningfully use that for the *existence* of the endpoint which is the problem we are trying to solve here, vs. the *results* of using the endpoint (which is what HTTP caching applies to)
#
sknebel
thats what I mean, yes
#
[tantek]
nevermind that caching the results of a POST are also disallowed I believe
#
[tantek]
e.g. Webmention, Micropub, IndieAuth endpoints
#
[tantek]
so you aren't even allowed to cache "step 3" in those cases
#
sknebel
post responses can be cached if explicitly indicated as such AFAIK, but its rarely implemented
#
sknebel
potentially one could have a pattern to rerun discovery for a cached value if the endpoint starts to return errors, but that would mean the endpoint would need to stop working once it isnt responsible anymore. which means it'll go wrong in practice
#
aaronpk
that sounds like activitypub account migration 😂
#
aaronpk
the account you're migrating from has to send the redirect to the new account
#
aaronpk
so if I wanted to give people a way to migrate their webmention.io endpoint, i'd need to have it return their new endpoint
#
sknebel
but thats not needed, you can rerun discovery
#
aaronpk
or more to your point, i would need to return an error for people who have shut down their hosted account
#
sknebel
question of the scope of caching is also fun. per-page? - limited use, but ok for things like bridgy probably. per-domain? likely to cause issues as soon as setup get a bit unique
gRegor joined the channel
#
[snarfed]
wish I could hang out for more of this conversation! sadly I'm afk for most of the day. all this ^ sounds reasonable so far. my one concern is, whatever mechanism we end up with, it may only see a small amount of adoption, like anything opt-in
#
[snarfed]
so, the one thing I'd ask for is a provision for _default_ caching, for wm receivers that don't specify this new caching mechanism
#
[snarfed]
eg by default, wm endpoints may be cached for 2h, per [domain or something]
#
[snarfed]
(could be per-protocol)
#
aaronpk
if we end up with something like `<link rel="webmention" href="..." cache="30d">` i would be happy to add that with some reasonable default value to the webmention.io setup docs
#
aaronpk
ultimately a webmention sender might decide to ignore the hint anyway, like bridgy might want to set its own minimum caching time to avoid someone saying only cache this for 1 minute or something
#
[tantek]
[snarfed] agreed that we need to solve this even only for link rel discovery consuming code, without requiring a new mechanism for link rel discovery publishers
#
[tantek]
aaronpk, I like that use of "cache" as an attribute, presumably we can treat it similar to "type" on links which is advisory but not canonical
#
[tantek]
is there an existing cache time string format we can re-use for the attribute value rather than make up something new? e.g. the "type" attribute on link/a uses the same (or a subset of?) HTTP Content-Type
#
aaronpk
html datetime uses the "P*" format
#
aaronpk
e.g. "P2D" "PT15H"
#
[tantek]
that looks oddly like iCal DURATION format
#
[tantek]
oof I had forgotten we asked for / proposed duration in HTML <time> as an option, and lacking anything better I'm fairly certain I would have referenced re-using iCal there
#
[tantek]
I think since this affects HTTP more than content semantics, I'd prefer to re-use HTTP cache header syntax than HTML time element
[jacky] joined the channel
#
aaronpk
is there anything in the set-cookie header that might use a duration syntax?
#
aaronpk
max-age, that's the one
#
aaronpk
looks like it's just an integer seconds
#
aaronpk
simple enough
#
[tantek]
One question is, is there a need in any of the use-cases for the more complex vocabulary of cache control directives? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
#
[tantek]
and should we use that same one attribute for generalizing discovery to other permalinks or the domain as a whole, or another attribute?
#
[tantek]
as in, yes you may cache this discovery for a week, vs you may re-use this discovery on other posts on this domain, or domain home page (or both) for a week
#
aaronpk
i suppose the way to avoid the opt in problem is to instead recommend some default behavior for senders, and then if a publisher knows the default is wrong for some reason, can use the cache indicator to suggest an alternative
#
aaronpk
like if I know that bridgy (and most others) are caching a webmention endpoint for my whole domain for 24 hours, and I have a particular page where I want to use a separate special endpoint, I could add an attribute that says "actually don't use this endpoint for the rest of the domain"
#
[tantek]
yes, that *and* I believe POST can support redirect too right?
#
[tantek]
so even if a sender does use your default wm endpoint for a "particular page", you can redirect it serverside to the special endpoint as a repair action
#
aaronpk
i forget the status code but one of them is meant for that, where the HTTP client is supposed to re-send the post body parameters to the new url
#
aaronpk
rather than the browser behavior which is to make a GET to the redirected-to location (like after you submit a form you get redirected somewhere)
#
aaronpk
oh right, i should have remembered that, because there's a specific note to not use that in OAuth https://www.ietf.org/archive/id/draft-ietf-oauth-security-topics-15.html#name-307-redirect
jonnybarnes and [pfefferle] joined the channel
#
aaronpk
in other news, i really want to figure out how to post 360 photos to my website
#
aaronpk
one problem with not having my own posting interface in my site is i have to first figure out how to represent things in microformats in order to make a micropub request to my site 😂
[schmarty] joined the channel
#
[schmarty]
I also want this for videos, honestly
#
aaronpk
videos already has a separate video parameter, do you need something else?
#
[schmarty]
360 images are already images, do you need something else? :zany_face:
#
aaronpk
they do require different presentation/display tho
#
aaronpk
videos are just a bunch of still images in a row 🤯
#
[schmarty]
Ah I didn't clarify that I meant 360 video, haha
#
[schmarty]
Context!! Sorry for the rude emoji
#
[schmarty]
I would also love to work up something for "animated GIFs" which are now best-practiced as videos with varying degrees of autoplay and loop counts allowed, and image fallbacks (and don't forget alt text)
#
aaronpk
yeah that's an interesting one
#
aaronpk
these aren't exactly new *types*, they are more like presentation hints
#
[schmarty]
"Technically" it's just presentation hints. But it matters! My dreams of many wacky micropub clients get stifled by this thinking.
#
aaronpk
ok presentation requirements
#
[schmarty]
One might say u-photo vs an img inside e-content is a presentation hint. u-photo vs u-featured is definitely presentation hinting
#
aaronpk
everyone still calls them animated gifs even if they are actually mp4 encoded videos huh
#
sknebel
(whats the state of browser support for putting video files in <img src=>?)
#
sknebel
(to add another layer of fun ;))
#
[schmarty]
sknebel: to my knowledge Safari will do mp4s and that's it for browser support
#
sknebel
yeah, was just checking, seems that was a thing Safari just did and none of the other browsers liked
#
[tantek]
aaronpk, [schmarty] the answer to "how do I post a new type of thing" is the same as it ever was. Use the closest existing "generic" type for it and a hashtag, get experience publishing it, and then if there are multiple people doing so (with a consuming code use-case) we can figure out markup for interop
#
aaronpk
the consuming use case is displaying the post in a reader or comment or reply context
#
[tantek]
if your goal is (primarily) your own implementation, using a hashtag to "subtype" should be sufficient for your code to detect and alter presentation accordingly
#
[tantek]
and if a hashtag is too intrusive, you can also find a suitable emoji. we've done some of that for e.g. /read posts
#
[schmarty]
microformats pedantry: do you mean a `category`? :}
#
[schmarty]
that approach is interesting for something like a "gif" - but also any video with a poster image or image fallback. i'd send `u-video` and `u-photo` (with `alt` on the `u-photo`?)
#
[schmarty]
bonus for "gif" is that the microformats consuming case is immediate: these are meant to be responses that show up on other folks' sites.
#
[tantek]
[schmarty] yes a hashtag (human visible) marked up as a mf2 category 🙂
#
[schmarty]
aaronpk: i am interested in an mf2 client for posting panoramic images so i am happy to chat about it and maybe slap something together. i've been enjoying my recent ports of my bayside.pub micropub clients to PHP and i think micropubkit is near a good place to make it quick.
#
[tantek]
wonders if [KevinMarks] can recall anything about the QTVR format for posting panoramic images, you know, from the 1990s
#
aaronpk
what is micropubkit?
#
Loqi
It looks like we don't have a page for "micropubkit" yet. Would you like to create it? (Or just say "micropubkit is ____", a sentence describing the term)
#
[KevinMarks]
There were at least a couple of variations - panoramic/spherical and cubic iirc
#
voxpelli
We spoke of IndieAuth and the Fediverse a few days ago, triggered by Pixelfed, now they posted: https://mastodon.social/@pixelfed/110731182392091206
#
voxpelli
They are looking into adding IndieAuth
#
Loqi
[preview] [pixelfed] We are working on OIDC support, and exploring IndieAuth!The Sign-in with Mastodon feature uses Mastodon specific APIs and is a temporary measure until we get OIDC in place and other platforms support it!#pixelfed #oidc #indieauth
#
aaronpk
interesting
#
[schmarty]
aaronpk: it's my attempt to package up PHP controllers and middleware common to micropub (and indieauth) clients. i tend to hack on it locally and it's not packaged at all so it's a secret to everyone. https://git.schmarty.net/schmarty/MicropubKit
#
[schmarty]
kapowski uses it if you want an example: https://git.schmarty.net/schmarty/kapowski-php
#
aaronpk
what is silorider?
#
Loqi
It looks like we don't have a page for "silorider" yet. Would you like to create it? (Or just say "silorider is ____", a sentence describing the term)
#
aaronpk
silorider is a command line utility for [[POSSE]] https://bolt80.com/silorider/
tei_, cobypear, tei_1, [pfefferle], [jacky], aciccarello and sebbu2 joined the channel