Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scales and read-only frontend #46

Open
krissik opened this issue Feb 4, 2022 · 1 comment
Open

Scales and read-only frontend #46

krissik opened this issue Feb 4, 2022 · 1 comment

Comments

@krissik
Copy link

krissik commented Feb 4, 2022

We have a Plone setup with two frontends. One for editors which uses read-write plone instances and one for publicity with read-only plone instances, this looks like this:

      ┌─────────────────┐                 ┌──────────────────┐
      │ www.oursite.com │                 │ cms.oursite.com  │
      │ for publicity   │                 │ for editors      │
      └───────┬─────────┘                 └────────┬─────────┘
              │                                    │
              │                                    │
              ▼                                    ▼
 ┌────────────────────────────┐        ┌───────────────────────────┐
 │ read-only plone instances  │        │read-write plone instances │
 └─────────────┬──────────────┘        └───────────┬───────────────┘
               │                                   │
               │                                   │
               │                                   │
               │            ┌───────────┐          │
               └─────────►  │           │ ◄────────┘
                            │    ZEO    │
                            │           │
                            │           │
                            └───────────┘

cms.oursite.com is only accessible from our intranet - so we have some extra security here.

If an image scale is not accessed via cms.oursite.com before it is accessed via www.oursite.com we will get an "ReadOnlyError" because scaling happens on demand.

We have tried to work around this issue by creating scales on save but it is not very reliable.

Now we consider read-write access from www.oursite.com but maybe there is an other better solution for this?

@yurj
Copy link

yurj commented Feb 4, 2022

You can ask in https://community.plone.org/
You can catch ReadOnlyError and do a subrequest to cms.oursite.com to create the image, then continue if successful. Another option is to use the proxy (apache, varnish, ngix) to react to an 500 http error on images. You can also use the event handler on image creation to force the creation of all scales. Or change the scaling methods to scale all sizes instead of the requested one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants