FSharp.Data
FSharp.Data copied to clipboard
[HtmlProvider] How to Cache a request made by .Load(url)
How can I cache a request made using .Load() so on the second request to same page, the result is loaded from cache?
#1st request to /api/v1/carousel
JsonResult(HtmlDocument.Load("https://www.saibatudomt.com.br/").CssSelect(".stmt-block-larger.carousel").CssSelect("a")
|> Seq.choose (fun x ->
x.TryGetAttribute("href")
|> Option.map (fun a -> x.DirectInnerText(), a.Value())
))
#2nd request to /api/v1/mixed
JsonResult(HtmlDocument.Load("https://www.saibatudomt.com.br/").CssSelect(".duas-colunas .stmt-block-mixed").CssSelect("a")
|> Seq.choose (fun x ->
x.TryGetAttribute("href")
|> Option.map (fun a -> x.DirectInnerText(), a.Value())
))