JosephSilber / page-cache

Caches responses as static files on disk for lightning fast page loads.
MIT License
1.21k stars 118 forks source link

Add application/vnd.api+json support so files are saved as .json file #114

Open ssglopes opened 7 months ago

ssglopes commented 7 months ago

Hi, Would it be possible to add contentType: application/vnd.api+json so this package would be compatible with https://laraveljsonapi.io/ as that package expects application/vnd.api+json

    protected function guessFileExtension($response)
    {
        $contentType = $response->headers->get('Content-Type');

        if ($response instanceof JsonResponse ||
            $contentType == 'application/json' ||
            $contentType == 'application/vnd.api+json' // <= would it be possible to add this line 
        ) {
            return 'json';
        }