mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-07 16:45:58 +03:00
[BridgeAbstract] Add getSimpleHTMLDOMCached function
parent
18bfd57b78
commit
662e11923d
1 changed files with 11 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue