volto icon indicating copy to clipboard operation
volto copied to clipboard

feat!: new implementation for the proxy middleware. (express-http-middleware)

Open mamico opened this issue 1 year ago • 4 comments

This is an alternative implementation of #5299 which uses express-http-middleware. Compared to the other implementation, this one tries to implement the task ‘handle errors (not found, not authorised, ...) correctly’.

It is a PoC in which only the 404 error is implemented, and there is some code to correct (e.g. duplicate code).

mamico avatar Sep 24 '24 16:09 mamico

Deploy Preview for plone-components canceled.

Name Link
Latest commit 75510776866ebc4787b7de65325c2daff058d82e
Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66f2e7524c0d430008874854

netlify[bot] avatar Sep 24 '24 16:09 netlify[bot]

Deploy Preview for plone-components canceled.

Name Link
Latest commit ded7f873aa3e14ec4d76e65f520e3bcfc79fc364
Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66f2e9339194d700088c4c90

netlify[bot] avatar Sep 24 '24 16:09 netlify[bot]

@mamico Is the idea of ​​the proxy to handle private content? I wonder if the request from anonymous users could not go directly to Plone.

wesleybl avatar Sep 24 '24 19:09 wesleybl

@mamico Is the idea of ​​the proxy to handle private content? I wonder if the request from anonymous users could not go directly to Plone.

@wesleybl Not really. The file/image proxy implementation has been there on Volto from the beggining, this fix and its twin #5299, where you can find more details, is intended to improve performance in terms of memory and response time.

On the other hand, regarding whether to use the Volto proxy or set route on the reverse proxy to point directly to Plone. The points: handling authentication (as you said), but also, for example, handling error pages, such as 404. In fact pointing from reverse proxy directly to Plone, without any specific intervention on reverse proxy or on Plone, when faced with a missing resource, you would have the 404 page from Plone. Which is not so good ...

mamico avatar Sep 25 '24 08:09 mamico

Hi There! 👋

We haven't seen any activity on this pull request in a while :sleeping:, and we want to make sure that it's still relevant. Please let us know by:

  • adding a comment about what needs to be done next 💬
  • updating its status and other labels 🏷️

Otherwise close this pull request. 🧹

github-actions[bot] avatar Mar 26 '25 14:03 github-actions[bot]

implented as an addon https://github.com/collective/volto-middleware-binary

mamico avatar Sep 07 '25 17:09 mamico