flarum / flarum/issue-archive

Support webserver caching

Open
#324 11 comments 1 reaction 0 assignees View on GitHub
type/feature
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

- Set ETag and Last-Modified headers on response
- Compare If-Modified-Since header on request
- Return 304 Not Modified if not stale

See:
http://whitequark.org/blog/2014/04/05/page-caching-with-nginx/
http://apidock.com/rails/ActionController/ConditionalGet/stale%3F

Trying to think of the best way to do this... I guess on `Api\AbstractSerializeController` we can have some kind of method that returns an etag/last modified timestamp which the `handle` method checks and returns the appropriate response. Then our subclass controllers can override that method to provide appropriate data.

Contributor guide

Open the contributing guide

Research direction

Start with Api\AbstractSerializeController and its handle method, then trace the response and request handling paths. Use the listed ETag, Last-Modified, and If-Modified-Since requirements as the acceptance criteria; done means stale responses return 304 Not Modified and fresh responses include the required caching headers.

Written by the indexing model from the issue text.

Assessment

Domain
api, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.