create-prisma-php-app 4.1.1 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1192,8 +1192,11 @@ try {
1192
1192
  }
1193
1193
 
1194
1194
  if ((!Request::$isWire && !Bootstrap::$secondRequestC69CD) && isset(Bootstrap::$requestFilesData[Request::$decodedUri])) {
1195
- if ($_ENV['CACHE_ENABLED'] === 'true') {
1196
- CacheHandler::serveCache(Request::$decodedUri, intval($_ENV['CACHE_TTL']));
1195
+ $shouldCache = CacheHandler::$isCacheable === true
1196
+ || (CacheHandler::$isCacheable === null && $_ENV['CACHE_ENABLED'] === 'true');
1197
+
1198
+ if ($shouldCache) {
1199
+ CacheHandler::serveCache(Request::$decodedUri, intval($_ENV['CACHE_TTL'] ?? 600));
1197
1200
  }
1198
1201
  }
1199
1202
 
@@ -1212,7 +1215,10 @@ try {
1212
1215
  MainLayout::$html = "<!DOCTYPE html>\n" . MainLayout::$html;
1213
1216
 
1214
1217
  if (
1215
- http_response_code() === 200 && isset(Bootstrap::$requestFilesData[Request::$decodedUri]['fileName']) && $_ENV['CACHE_ENABLED'] === 'true' && (!Request::$isWire && !Bootstrap::$secondRequestC69CD)
1218
+ http_response_code() === 200
1219
+ && isset(Bootstrap::$requestFilesData[Request::$decodedUri]['fileName'])
1220
+ && $shouldCache
1221
+ && (!Request::$isWire && !Bootstrap::$secondRequestC69CD)
1216
1222
  ) {
1217
1223
  CacheHandler::saveCache(Request::$decodedUri, MainLayout::$html);
1218
1224
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",