Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Allow caching requests to endpoints that serve immutable content #195

Description

@rudolfs

We could potentially allow browsers caching the following endpoint responses indefinitely:

/v1/projects/:project/commits/:sha
/v1/projects/:project/tree/:sha/*path
/v1/projects/:project/blob/:sha/*path
/v1/projects/:project/readme/:sha

Because the content is addressed by a SHA and shouldn't change (unless there's a collision).

But unfortunately the responses contain a lastCommit attribute which can vary. Looking at the front-end code, we only use this attribute when querying the /v1/projects/:project/blob/:sha/*path endpoint. And even that could be fetched in a separate request.

Therefore I propose we remove the lastCommit attribute from all the requests and create a separate endpoint for getting the lastCommit info for a blob and update the front-end. And finally add caching headers to all the endpoints.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions