question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incoming "last-modified" requests

See original GitHub issue

Clients, upon receiving resources with a Last-Modified header, may send requests that contain one or both of the above linked headers. I think handling these headers would be outside the scope of this plugin. At best, I think the incoming request object could be decorated with the values of these headers, e.g.:

fastify.decorateRequest('ifModifiedSince', function () {
  if (!this.req.headers['if-modified-size']) return null
  return new Date(this.req.headers['if-modified-since'])
})

Do you agree @fastify?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Sep 25, 2017

Express / Koa use the fresh module for this logic, if that helps at all.

0reactions
jsumnerscommented, Nov 4, 2017

I have opted to ignore the Last-modified mechanism and only support the ETag mechanism. The ETag standard has been around long enough that web browsers should support it. If the desire it to give the clients a hint to not issue a request to the server, then the Expires header can be sent along with the ETag header.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incoming HTTP Requests | dotTrace Documentation - JetBrains
The Incoming HTTP Requests: Method sub-filter shows distribution of Incoming HTTP Requests time between requests with particular methods.
Read more >
Last-Modified - HTTP - MDN Web Docs - Mozilla
The Last-Modified response HTTP header contains a date and time when the origin server believes the resource was last modified.
Read more >
Request and response behavior for custom origins
Caching. Ensure that the origin server sets valid and accurate values for the Date and Last-Modified header fields.
Read more >
Evaluating request preconditions using Request objects - IBM
You have used the javax.ws.rs.core.Request object to evaluate the HTTP headers of an incoming request, and determine the proper response to the request....
Read more >
HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types ... instead of a date taken from the Last-Modified header for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found