Add sha256 of pages contents to pages_deployments
We should add a sha256 of content to pages_deployments
. It would also help to expose that in LookupPath API. This could be used as a cache-key for refresh purposes that we discussed in gitlab-pages#481 (closed)
vshushlin 19 hours ago
Why? :smiley:
kamil 19 hours ago
Why adding sha256?
kamil 19 hours ago
This allows us to ensure that content is still valid. Otherwise we have no way of knowing if data is stored is valid, as we don’t have any checksum stored.
kamil 19 hours ago
(we use it for all other file uploaders)
kamil 19 hours ago
file_sha256 bytea (edited)
vshushlin 18 hours ago
Ok, but will we ever validate this checksum? I don't expect we'll do that on the pages side.
As for the cache key, you can just use URL without query parameters - it will be uniq per deployment :smiley:
But I'm not against adding the checksum
kamil 18 hours ago
@vshushlin We might need at some point. The GCS/S3 offers a way to use this sha256 in some cases.
kamil 18 hours ago
As for the cache key, you can just use URL without query parameters - it will be uniq per deployment
I tried that. This is pretty complex to get right. As URL does not tell you anything about the content. You assume that URL is unique, which is in most cases, but this is kind of clumsy as well :slightly_smiling_face: