NIP-17 uses kind 1059, which are regular events and stay around forever. I switched to ephemeral events because I don’t want them stay around forever- just 10 minutes so the receiver can get them. I also want a relay to have the ability to carry out request deletes of NIP-59 events addressed to a pubkey, versus only the author of the event.
Discussion
yeah, you can put an expiration tag on any event kind and have it disappear if the relay allows it, so for this case you don't use ephemeral type, which are specified to not be stored
the actual implementation of expirations though, the "lazy" method that i have applied is simply that when it fetches an event from the db, if it reads an expiration that is passed, it doesn't include it and deletes it, but if nobody asks for it, it is just left there. to implement it dynamically so the event is deleted properly requires a scheduler and a worker thread that performs the action on a timer. this can be a lot more costly in terms of memory and processing if the relay does this a lot. there is probably a third approach that just does a routine scan every hour or so that would be a bit more of an in-between in terms of memory and processing cost.