mjackson / mjackson/strata

Add 304 support to the file middleware

Open
#29 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
364
Forks
33
PR merge metrics
No merged PRs in 30d

Description

While I don't believe a framework at this level should be sending Expires headers, there is no reason it can't implement 304 support using either Etags or LastModified headers (or maybe even both).

For etags, I would suggest something fast like https://github.com/c9/vfs/blob/master/local/localfs.js#L30-32 instead of hashing the content of the file or some other expensive operation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation file or test is named in the issue. Start by locating the file middleware and its HTTP response handling, then review the referenced ETag approach and existing header behavior; done means conditional requests can use ETags or Last-Modified information and receive a 304 response without an unnecessary file body.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.