Affects Version/s: None
Fix Version/s: None
Component/s: Proxy Repository
This is just for discussion's sake, not for NX2 change implementations (but rather for NX3):
In NX2, when proxy cached item is expired, NX2 issues a HEAD request to remote to detect if remote item is changed or not. But, only Last-Modified header is used from response to check for remote change (as ETag is not cached, and item size is not passed on).
HEAD response might contains more meaningful bits, that could be used for change detection:
- Last-Modified (currently used by NX2, but has second resolution due to date formatting, could be used to craft conditional request)
- Content-Length (compare cached size and remote size, if known)
- ETag (should be cached along with item metadata if sent. If known, could be used to craft conditional request, or compare with response contained one)
Also, HEAD could be swapped for a conditional GET (using request headers like if-modified-since and/or if-match and it's variations).
This affects NX2 Maven proxies (basically all proxies using HttpClientRemoteStorage as transports), while formats like NPM proxy uses own transport and uses ETag for same purpose (as npm registries must implement ETags).