Skip to content
  • Jordan Williams's avatar
    Add hash-based image caching · 58b79f53
    Jordan Williams authored and Jordan Petridis's avatar Jordan Petridis committed
    This commit adds another cache validation parameter.
    Previously, support for time-based caching was added.
    This may not retrieve updated images very quickly for the user.
    Thus, the image's URI is checked for changes.
    A hash value of the image's URI is updated when it is downloaded.
    When feeds are updated, the image URI is checked against this hash.
    If the hash has changed the image is downloaded and the hash updated.
    
    The hash function uses Rust's standard hasher.
    This produces a 64-bit unsigned integer.
    The caveat is that sqlite doesn't support unsigned integer values.
    To get around this, the hash function converts this to a signed integer.
    I should probably double check the corner cases of the cast done here.
    
    Tests still need to be added for this functionality.
    The changelog will also need to be updated in a subsequent commit.
    58b79f53