You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever end users are allowed to submit feed URLs to fetch, there's always a possibility of typo in the host or path and in case the response for the feed is failed connection or some resource that cannot be turned into feed, it would be nice to be able to cache the failed response.
I think this should be opt-in because it would change the default behavior of the library otherwise.
Possible solution
Add new API point:
class SimplePie
{
# ...
/**
* @param int $seconds The cache expiry time for cached failed requests. Use 0 to disable caching of failed requests.
*/
public function set_cache_remember_failure($seconds=60*15)
{
# ...
}
# ...
(and obviously implement the code that checks if the URL has failed in the past and if failed duration hasn't yet passed, return failed response to the caller instead of waiting for timeout).
This would allow pages that want to embed RSS feeds to keep high performance even if the remote host goes down because only one request per failed cache expiry period would stall for trying to connect the remote host that's actually down.
The text was updated successfully, but these errors were encountered:
Nice to have: if force_cache_fallback(true) has been set, allow marking existing cache with the latest known good feed as failed so that it will not be retried until the failed cache expiry time has elapsed but instead the last known good copy is returned immediately.
Whenever end users are allowed to submit feed URLs to fetch, there's always a possibility of typo in the host or path and in case the response for the feed is failed connection or some resource that cannot be turned into feed, it would be nice to be able to cache the failed response.
I think this should be opt-in because it would change the default behavior of the library otherwise.
Possible solution
Add new API point:
(and obviously implement the code that checks if the URL has failed in the past and if failed duration hasn't yet passed, return failed response to the caller instead of waiting for timeout).
This would allow pages that want to embed RSS feeds to keep high performance even if the remote host goes down because only one request per failed cache expiry period would stall for trying to connect the remote host that's actually down.
The text was updated successfully, but these errors were encountered: