Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set expiration date for web resource #36

Open
LiNk-NY opened this issue Jan 11, 2022 · 2 comments
Open

set expiration date for web resource #36

LiNk-NY opened this issue Jan 11, 2022 · 2 comments

Comments

@LiNk-NY
Copy link

LiNk-NY commented Jan 11, 2022

Hi Lori, @lshep

Is it possible to set an expiration date for a URL resource within the bfcadd function or any other function?
I tried this and it doesn't work.

library(BiocFileCache)
#> Loading required package: dbplyr
bfc <- BiocFileCache()
tfile <- "https://bioconductor.org/checkResults/3.15/bioc-LATEST/report.tgz"
treport <- bfcadd(
    bfc, rname = tfile, fpath = tfile, expires = Sys.Date() + 2
)
res <- bfcquery(bfc, tfile, exact = TRUE)
res
#>   id  rid                                                             rname
#> 1  9 BFC9 https://bioconductor.org/checkResults/3.15/bioc-LATEST/report.tgz
#>           create_time         access_time                    rpath rtype
#> 1 2022-01-11 23:04:43 2022-01-11 23:04:48 179285b1b6faf_report.tgz   web
#>                                                               fpath
#> 1 https://bioconductor.org/checkResults/3.15/bioc-LATEST/report.tgz
#>    last_modified_time                  etag expires
#> 1 2022-01-10 16:08:46 77b841f-5d53c8d250fe7      NA

Created on 2022-01-11 by the reprex package (v2.0.1.9000)

Thanks!
-Marcel

@lshep
Copy link
Contributor

lshep commented Jan 12, 2022

think we thought it should be automatic based on HEAD/certificate information and every time it checks the header may override it --- I'll think about how to remedy this

@LiNk-NY
Copy link
Author

LiNk-NY commented Jan 12, 2022

Thanks Lori.
I guess this method might work for the first expiration but not for subsequent ones of the resource.
Perhaps there could be an argument expires_every that takes the number of days as input?
It would override the automatic expiration if any.

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

No branches or pull requests

2 participants