diff --git a/src/Response.php b/src/Response.php index 4d24a9dd..f3d2844d 100644 --- a/src/Response.php +++ b/src/Response.php @@ -2,7 +2,6 @@ namespace Inertia; -use Carbon\CarbonInterval; use Closure; use GuzzleHttp\Promise\PromiseInterface; use Illuminate\Contracts\Support\Arrayable; @@ -70,13 +69,6 @@ class Response implements Responsable */ protected $viewData = []; - /** - * The cache duration settings. - * - * @var array - */ - protected $cacheFor = []; - /** * The URL resolver callback. */ @@ -154,19 +146,6 @@ public function rootView(string $rootView): self return $this; } - /** - * Set the cache duration for the response. - * - * @param string|array $cacheFor - * @return $this - */ - public function cache(string|array $cacheFor): self - { - $this->cacheFor = is_array($cacheFor) ? $cacheFor : [$cacheFor]; - - return $this; - } - /** * Create an HTTP response that represents the object. * @@ -188,7 +167,6 @@ public function toResponse($request) ], $this->resolveMergeProps($request), $this->resolveDeferredProps($request), - $this->resolveCacheDirections($request), $this->resolveScrollProps($request), $this->resolveOnceProps($request), ); @@ -456,28 +434,6 @@ public function resolvePropertyInstances(array $props, Request $request, ?string return $props; } - /** - * Resolve the cache directions for the response. - * - * @return array - */ - public function resolveCacheDirections(Request $request): array - { - if (count($this->cacheFor) === 0) { - return []; - } - - return [ - 'cache' => collect($this->cacheFor)->map(function ($value) { - if ($value instanceof CarbonInterval) { - return $value->totalSeconds; - } - - return intval($value); - }), - ]; - } - /** * Parse props from request headers. *