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

多实例部署场景,开启缓存预览pdf报错 #606

Open
junyi-tiger opened this issue Nov 29, 2024 · 1 comment
Open

多实例部署场景,开启缓存预览pdf报错 #606

junyi-tiger opened this issue Nov 29, 2024 · 1 comment

Comments

@junyi-tiger
Copy link

junyi-tiger commented Nov 29, 2024

我使用了nginx、docker进行多实例容器化部署,但在开启缓存且多实例部署的场景下,由于pdf预览界面会返回缓存后的文件地址,但这个缓存文件在其他实例中不存在,如果访问到其他实例,会报错。
举例:预览接口:/onlinePreview,如果调用了这个接口,则会将文件下载到本地,然后返回一个前端页面给浏览器,页面中有这个缓存文件的地址/file,这个缓存文件地址也会访问预览服务服务器,读取本地缓存的文件。现在有一个问题,如果我启动了两个预览服务1和2,第一个/onlinePreview请求打在服务1上,但是前端页面中的请求(请求缓存文件的地址)可能负载到另一个服务2上,这时候服务2上还没有缓存该文件,会报错,请问该问题有解决方案吗?

@gitchenjh
Copy link
Member

多实例需要挂载共享 /file /cahce 两个目录

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