* zin: only use client cache when turn on zin.zinTool.

This commit is contained in:
sunhao
2024-05-23 14:50:55 +08:00
parent 0e96bad538
commit 123ccb41f3
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -59,7 +59,8 @@ class node implements \JsonSerializable
public function __construct(mixed ...$args)
{
$this->gid = 'zin_' . uniqid();
global $config;
$this->gid = (isset($config->zinTool) && $config->zinTool) ? static::nextGid() : 'zin_' . uniqid();
$this->props = new props();
disableGlobalRender();
+1 -1
View File
@@ -475,7 +475,7 @@
if(options.modal) headers['X-Zui-Modal'] = 'true';
const requestMethod = (options.method || 'GET').toUpperCase();
if(!options.cache && options.cache !== false) options.cache = requestMethod === 'GET' ? (url + (url.includes('?') ? '&zin=' : '?zin=') + encodeURIComponent(selectors.join(','))) : false;
options.cache = false; // Disable local cache for 20.1.
if(!window.zin || !window.zin.zinTool) options.cache = false;
const cacheKey = options.cache;
let cache;
const renderPageData = (data, onlyZinDebug) =>