Skip to content

Add configurable cache entry expiration #31

@elrayle

Description

@elrayle

I am exploring adding cache entry expiration. I would like to get feedback from those using linked-data-fragments for caching.

Approach:

TimeToLive configuration - There will be a global TimeToLive value that serves as a default. There can also be a TimeToLive interval defined per host with the default used if the current URI's host does not have a separate TimeToLive configured.

ExpirationDT for a URI - Each cached URI will have an extra triple added to identify the date-time on which the cached entry for the URI expires and becomes invalid. ExpirationDT = date_retrieved + TimeToLive(URI_host)

Modifications to Retrieval Algorithm

    if ExpirationDT < now, attempt to get from source
        if success
            update URI's cached value
            reset ExpirationDT
            return value
        if source unavailable
            do NOT adjust ExpirationDT
            Log host out of service
            return value
    else
        return value from cache

Predicate for ExpirationDT - I have not found a predicate that matches the concept exactly. The closest I have at the moment is http://vivoweb.org/ontology/core#expirationDate. I am open to suggestions for an alternate predicate.

Other additions that could be part of this work.

Optional ForceRecache - Retrieve method can have a parameter added to allow caller to request the URI's cache be updated from source. What would you want returned if the host is out of service?

LastModifiedDT - Add a new triple that holds the LastModifiedDT for the cache.

Thoughts on predicate choices. I am somewhat hesitant to use existing predicates that aren't cache specific. If the cached URI happens to use the same predicates, they would get clobbered by the cache added predicates. I'd like to see predicates: cache_expiration_dt and cache_last_modified_dt, and possible cache_create_dt. Others thoughts?

Please comment on this approach as soon as you can. I am looking at beginning work as soon as I get feedback.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions