Skip to content

Commit

Permalink
Fix 302/304 mixup (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmijos authored Sep 15, 2024
1 parent 0a63301 commit 11e59ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ Import your module on the specific page. Note: you'll likely want to use a `cont

## Include a digest of the import map in your ETag

If you're using [ETags](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) generated by Rails helpers like `stale?` or `fresh_when`, you need to include the digest of the import map into this calculation. Otherwise your application will return 302 cache responses even when your JavaScript assets have changed. You can avoid this with something like:
If you're using [ETags](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) generated by Rails helpers like `stale?` or `fresh_when`, you need to include the digest of the import map into this calculation. Otherwise your application will return [304](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304) cache responses even when your JavaScript assets have changed. You can avoid this with something like:

```ruby
class ApplicationController < ActionController::Base
Expand Down

0 comments on commit 11e59ae

Please sign in to comment.