koajs / koajs/static-cache

Why not support defining cacheControl for certain file

Open
#71 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
291
Forks
48
PR merge metrics
No merged PRs in 30d

Description

// static-cache/index.js
198 obj.cacheControl = options.cacheControl // why not: obj.cacheControl = obj.cacheControl ? obj.cacheControl : options.cacheControl ?
199 obj.maxAge = obj.maxAge ? obj.maxAge : options.maxAge || 0

Contributor guide

Open the contributing guide

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

Start in static-cache/index.js at lines 198-199 and inspect how cacheControl and maxAge are assigned for each file. Preserve a file-specific cacheControl value when present, while using the configured option as a fallback; confirm the resulting behavior for files with and without their own value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.