Skip to content

Commit

Permalink
Lots of caching improvements
Browse files Browse the repository at this point in the history
- Add Cache-Control to /__remix_manifest responses
- Don't call /__remix_data for routes that don't have data loaders
- Remove location-based browser data cache, use built-in caching instead
- Automatically reload the page when we detect the build has changed
- Add `useBeforeUnload` hook for saving state immediately before reload
- Add `json` and `redirect` helpers to `@remix-run/loader`

Fixes #3
Fixes #4
Fixes #7
Fixes #15
  • Loading branch information
mjackson committed Oct 17, 2020
1 parent e46d992 commit 2755930
Show file tree
Hide file tree
Showing 30 changed files with 1,123 additions and 1,103 deletions.
18 changes: 18 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

This is a history of changes to [Remix](https://remix.run).

## Unreleased

## Features

- Added Cache-Control to `/__remix_manifest` responses for better cacheability
([#4](https://github.com/remix-run/remix/issues/4))
- Remove location-based browser data cache, use built-in caching instead
([#15](https://github.com/remix-run/remix/issues/15))
- Automatically reload the page when we detect the build has changed
([#7](https://github.com/remix-run/remix/issues/7))
- Added `useBeforeUnload` hook for saving state immediately before reload
- Added `json` and `redirect` helpers to `@remix-run/loader`

## Bug Fixes

- Don't call `/__remix_data` for routes that don't have data loaders
([#3](https://github.com/remix-run/remix/issues/3))

## 0.4.0 - Thu Oct 15 2020

### Features
Expand Down
21 changes: 15 additions & 6 deletions fixtures/gists-app/data/routes/gists.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
const { json } = require("@remix-run/loader");

module.exports = () => {
return {
users: [
{ id: "ryanflorence", name: "Ryan Florence" },
{ id: "mjackson", name: "Michael Jackson" }
]
};
return json(
{
users: [
{ id: "ryanflorence", name: "Ryan Florence" },
{ id: "mjackson", name: "Michael Jackson" }
]
},
{
headers: {
"Cache-Control": "public, max-age=60"
}
}
);
};
Loading

0 comments on commit 2755930

Please sign in to comment.