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
{{ message }}
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
The caching mechanism uses under the hood the Symfony Cache package.
343
+
So, you can use the Adapter supported the Symfony Cache.
344
+
For example, for using a MySql database as cache storage, you can setup the connection via the PHP PDO class:
345
+
```php
346
+
$client = new \Storyblok\Client('your-storyblok-private-token');
347
+
$pdo = new PDO('mysql:host=127.0.0.1;dbname=db_php-client;charset=utf8mb4;', "root");
348
+
$client->setCache('mysql', ['pdo' => $pdo]);
349
+
$result = $client->getStories();
350
+
print_r($result);
351
+
```
352
+
340
353
### Clearing the cache (Optionally if using setCache)
341
354
342
355
In order to flush the cache when the user clicks publish, you need to listen to the published event in javascript or define a webhook in the space settings that clears the cache on your server.
0 commit comments