Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider defining an expiry date for a TD #916

Closed
mlagally opened this issue Jun 18, 2020 · 9 comments
Closed

Consider defining an expiry date for a TD #916

mlagally opened this issue Jun 18, 2020 · 9 comments
Labels
Propose closing Problem will be closed shortly if there is no veto.

Comments

@mlagally
Copy link
Contributor

TDs may get outdated and new versions will be available.
It may be important to remind users of TDs about that.
This is also useful for thing directories, there was a corresponding discussion in the discovery TF.
w3c/wot-discovery#18

@egekorkan
Copy link
Contributor

I think it is a good idea. Just for added precision, TTL does not necessarily imply that the TD will change so even if a TD expires and a new one is fetched, the version can still be the same.

@benfrancis
Copy link
Member

Is there any reason that Thing Descriptions are different to any other web resource in this respect?

The web already has a solution to this problem. See the HTTP Expires header and the Cache-Control header for finer grained control.

@egekorkan
Copy link
Contributor

I think the goal is to have something inside the TD since the document can be stored in a database and can be consumed by different protocols

@benfrancis
Copy link
Member

I think the goal is to have something inside the TD since the document can be stored in a database and can be consumed by different protocols

I strongly recommend against that. Caching is hard to get right at the best of times, without having to worry about ambiguity between the protocol and file format.

I politely suggest resisting the temptation to re-invent features of web protocols with a WoT-specific solution in the name of being "protocol agnostic".

There is nothing to stop a WoT server implementation from storing an expiry date in its database and exposing that in a protocol-specific way, without it being in the Thing Description.

Note that CoAP also has its own caching model.

@sebastiankb
Copy link
Contributor

Are we talking about a new field in the TD model that should have an expiration date? If I understand correctly w3c/wot-discovery#18 will define this outside of the TD, right?

@farshidtz
Copy link
Member

Are we talking about a new field in the TD model that should have an expiration date? If I understand correctly w3c/wot-discovery#18 will define this outside of the TD, right?

I believe this issue is about adding a new field inside the TD.

In w3c/wot-discovery#18, we are exploring different options in the absence of such information inside the TD, especially for when the TD is submitted to a directory.

@sebastiankb
Copy link
Contributor

In this case the version container might be the right place:

"version": { "instance": "1.2.1", "expires": "2020-08-23T18:25:43.511Z"}

@farshidtz
Copy link
Member

In this case the version container might be the right place:

"version": { "instance": "1.2.1", "expires": "2020-08-23T18:25:43.511Z"}

Doesn't the expires field fit better alongside updated (and created) at the root level of the TD?

  • Unversioned TDs may also need an expiry date. But version.instance is mandatory and we can't have just "version": { "expires": "2020-08-23T18:25:43.511Z"}
  • A versioned TD's updated field will change when the version is incremented. Following this path, I could argue that updated should be in version too.

@egekorkan
Copy link
Contributor

By the way, this is now in the discovery spec: https://w3c.github.io/wot-discovery/#exploration-directory-registration-info

@egekorkan egekorkan added the Propose closing Problem will be closed shortly if there is no veto. label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Propose closing Problem will be closed shortly if there is no veto.
Projects
None yet
Development

No branches or pull requests

5 participants