You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
currently the incomming request is given to the constructur of 'Negotiator' and the 'availableMediaTypes' to 'negotiator.mediaTypes'. So for each request a new Negotiator instances needs to be created and the availableMediaTypes are prepared (at https://github.com/jshttp/negotiator/blob/master/lib/mediaType.js#L174)
Think changing the API constructor and availableMediaTypes is not possible due to backward compatibility. But maybe a new function which allows reusing the perpared priorities of the availableMediaTypes would be nice.
Thanks and kind regards,
Sven
The text was updated successfully, but these errors were encountered:
It would be really nice to cache the output. I am using this in my framework - fortjs. I am working on optimization and found that if we can cache the negotiation part which is same most of the time, then it would be great.
Hello,
currently the incomming request is given to the constructur of 'Negotiator' and the 'availableMediaTypes' to 'negotiator.mediaTypes'. So for each request a new Negotiator instances needs to be created and the availableMediaTypes are prepared (at https://github.com/jshttp/negotiator/blob/master/lib/mediaType.js#L174)
Think changing the API constructor and availableMediaTypes is not possible due to backward compatibility. But maybe a new function which allows reusing the perpared priorities of the availableMediaTypes would be nice.
Thanks and kind regards,
Sven
The text was updated successfully, but these errors were encountered: