SetCache
- Ariadne >
- Library >
- Ariadne 2.6 >
- Manuals >
- Programmers Reference >
- Classes >
- Object >
- PHP Methods >
(void) SetCache($file, $time, $image, $headers)
SetCache saves a new cache image. It has no return value.
| Argument | Description |
|---|---|
| $file | The filename of the cache image. |
| $time | The number of hours to keep the cache image. |
| $image | The cache image. |
| $headers | The headers (mimetype, etc) to keep with the image. |
SetCache() saves the given cache image with
the given filename in the public cache directory. It also saves the headers in
the public cache. The next request for the same page will be served from cache
instead of the store.
You should only use SetCache() when the page
is requested by the user public. Otherwise confidential information may become
public, as the cache circumvents all access controls. For a private cacheable
page, use the cached()
and savecache()
functions.

