api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.44k stars 869 forks source link

Caching of hydra:ApiDocumentation and Entrypoint #4074

Open lazka opened 3 years ago

lazka commented 3 years ago

For using the json-ld/hydra API I have to check https://demo.api-platform.com/docs.jsonld and https://demo.api-platform.com/.jsonld to figure out the types and operations which means two extra requests before the first real API call. These requests aren't cached, and slow things down.

I wonder if this couldn't be cached with etags since the content is static anyway. Am I missing something maybe?

dunglas commented 3 years ago

You're right, we must set etags and basic HTTP cache header on these endpoints, this could improve the performance of the admin a lot.

PR welcome!!

J3m5 commented 3 years ago

It would be really nice to have this. Not only the admin but all the clients that use the api doc parser. For us, the docs are about 280 KB in size and takes 1.3 s to fetch.