paulcwarren / spring-content

Cloud-Native Storage and Enterprise Content Services (ECMS) for Spring
https://paulcwarren.github.io/spring-content/
Apache License 2.0
272 stars 66 forks source link

Enable persist Renderable's conversion result by mimeType #320

Closed lmtoo closed 2 years ago

lmtoo commented 4 years ago

docx4j will convert docx to pdf if the request's Accept is application/pdf, but it will also slow the request , even for just 10 pages document, it will cost at least 30 seconds, if persist the conversion result when the first request, to will speed up subsequent request, also ,if original docx is changed ,auto cleanup conversion result.

paulcwarren commented 4 years ago

Hi @lmtoo,

Indeed. Storing renditions as additional content on the entity is a goal. The basic plan I have is to indicate which renditions you want to store on an Entity (perhaps through additional @Content(mimeType="application/pdf") annotations). The content would be converted the first time that rendition is accessed and returned as usual but also stored so that subsequent request for that rendition would not have to re-convert the content.

lmtoo commented 4 years ago

Entities may have different mimeTypes , for example Document may be doc/docx or xlsx. only doc/docx convert to pdf should be persist, and xlsx already exists a web preview solution , like sheetjs.