From 662e11923d5a5b73a7a3a547b7b7ce21830b0405 Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Sat, 10 Sep 2016 17:25:22 +0200 Subject: [PATCH] [BridgeAbstract] Add getSimpleHTMLDOMCached function --- BridgeAbstract.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/BridgeAbstract.md b/BridgeAbstract.md index ec3efdd..b6a8808 100644 --- a/BridgeAbstract.md +++ b/BridgeAbstract.md @@ -213,6 +213,7 @@ Following functions should be used for good practice and will support you with y * [`returnClientError`](#the-returnclienterror-function) * [`returnServerError`](#the-returnservererror-function) * [`getSimpleHTMLDOM`](#the-getSimpleHTMLDOM-function) +* [`getSimpleHTMLDOMCached`](#the-getsimplehtmldomcached-function) ## The `returnError` function @@ -254,6 +255,16 @@ This function is a wrapper around the [simple_html_dom](http://simplehtmldom.sou $html = $this->getSimpleHTMLDOM('your URI'); ``` +## The `getSimpleHTMLDOMCached` function + +This function does the same as the [`getSimpleHTMLDOM`](#the-getsimplehtmldom-function) function, except that the content received for the given URI is stored in a cache and loaded from cache on the next request if the specified cache duration was not reached. Use this function for data that is very unlikely to change between consecutive requests to **RSS-Bridge**. This function allows to specify the cache duration with the second parameter (default is 24 hours / 86400 seconds). + +```PHP +$html = $this->getSimpleHTMLDOMCached('your URI', 86400); // Duration 24h +``` + +**Notice:** Due to the current implementation a value greater than 86400 seconds (24 hours) will not work as the cache is purged every 24 hours automatically. + # Template This is the minimum template for a new bridge: