Closed wimleers closed 6 years ago
Also see https://www.drupal.org/node/2282603#comment-11441025 for the exact context/reason for me opening this.
@wimleers I was wondering what your thoughts are on embedded images - when making the request, the authorization token is added thus triggering a preflight request where origin is different - I don't know about you guys but that kind of came as a bit of a surprise to me as the assets in my nginx config are static and I'm not expecting a preflight. Perhaps it's my own peculiar setup?
I'm going to close this for now. I'm not sure how much effort should be put into waterwheel actually caching responses itself, perhaps your own middleware could handle those needs. If we want to reopen this, with some more context, perhaps around jsonapi that would be great.
See https://www.drupal.org/node/2282603. HAL+JSON has the notion of
_embedded
resources. But it embeds just links, not the actual resources. Which means the client must still go and fetch those.That's annoying. So Waterwheel should do that automatically.
And in doing so, Waterwheel should do client-side caching (much like React's Relay does client-side caching), to avoid re-requesting unchanged resources.
As for the precise implementation: TBD. Perhaps a
.getReference([reference_field_name])
-style API makes sense? (So you can doentity.getReference('user')
to get the author.)