Skip to content

Conversation

prem-prakash
Copy link

@prem-prakash prem-prakash commented Sep 5, 2024

The rack_response plugin ETAG response header is generated based on attributes that can remain the same even if the file content has been changed.

        # Value for the "ETag" header.
        def etag
          digest = Digest::SHA256.hexdigest("#{file.shrine_class}-#{file.storage_key}-#{file.id}")

          %(W/"#{digest.byteslice(0, 32)}")
        end

This may result in unwanted response caching.

@janko
Copy link
Member

janko commented Sep 6, 2024

Looks good to me, thanks 👍🏻 I would just rename the keyword argument to :etag, as it communicates better that we're overriding the ETag. Also, would you mind updating the documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants