rzo1 commented on PR #2002:
URL: https://github.com/apache/stormcrawler/pull/2002#issuecomment-4994774642

   > Looks good, are we sure `last-modified` needs lowercasing?
   
   Good question — I checked the code. Short answer: **for `main` (and thus the 
next release) the case doesn't matter, and lowercase is the better choice; for 
3.5.1 and earlier it would actually have to be `Last-Modified`.**
   
   Details:
   
   - Since #1827 (bb33f929, *make Metadata keys consistently 
case-insensitive*), `Metadata` normalizes all keys to lowercase on both write 
and read, so `last-modified` and `Last-Modified` in `metadata.persist` behave 
identically. Lowercase matches the internal stored form and the 
`AdaptiveScheduler` javadoc, which also documents `last-modified`.
   - On 3.5.1 and earlier (no #1827), `AdaptiveScheduler` stores the value 
under `org.apache.http.HttpHeaders.LAST_MODIFIED` = `"Last-Modified"` verbatim, 
and the `metadata.persist` filter lookup can't match a capitalized stored key 
from a lowercase config entry — so `last-modified` would silently fail to 
persist there. That's presumably why #2001 listed the capitalized form.
   
   Since this doc change ships with the next release (which includes #1827), 
lowercase is correct here — it just shouldn't be backported to docs for older 
releases.
   
   One small suggestion while we're at it: the sentence "The `last-modified` 
and `protocol.etag` fields allow conditional requests when 
`scheduler.adaptive.setLastModified` is enabled" is slightly misleading — 
`setLastModified` only controls whether the scheduler writes `last-modified` (→ 
`If-Modified-Since`); the `protocol.etag` / `If-None-Match` path works 
independently of that setting. Maybe reword to:
   
   > The `last-modified` field (written when 
`scheduler.adaptive.setLastModified` is enabled) and `protocol.etag` allow 
conditional requests (`If-Modified-Since` / `If-None-Match`).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to