Closed barryvdh closed 11 years ago
Hm that's something I'd rather have in the .json of cached pages, I prefer to let the actual cached content untouched. Will see what I can do.
Then again I'm lazy.
Maybe this would require a check to see if the response is html, otherwise this could lead to issues with non-html respones (like a GET json request) (Str::startsWith($response->headers->get('Content-Type'), 'text/html')
)
Well the question really is should JSON responses be cached ?
Why not? It depends on what you want to output, but a GET request should not modify anything and just return the same thing when called again, unless something has changed. I.e. loading the latest messages for a user, loading portfolio items, showing an RSS feed (XML instead of JSON), calculating some values based on GET params etc.
Not sure what you think of this, but it could be useful for debugging/checking of the Cache works / is correctly flushed.