Closed ShailendraKushwaha closed 3 years ago
let slp = SwiftLinkPreview(cache: InMemoryCache()) if let cached = slp.cache.slp_getCachedResponse(url: text) { success(cached) } else { // Perform preview otherwise slp.preview(text, onSuccess: {response in success(response) } , onError: {error in // print(error.localizedDescription) }) }
it always have to fetch response from online.
You should use url as the cached key.
if let url = self.slp.extractURL(text: textFieldText), let cached = self.slp.cache.slp_getCachedResponse(url: url.absoluteString) { }
it always have to fetch response from online.