OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
671 stars 96 forks source link

How to cache large excel files #3747

Closed shermaro91 closed 3 months ago

shermaro91 commented 11 months ago

Hello Team, I am using Excel API for developing Excel add-in.

My Environment Platform : PC desktop Host: Excel Office version number: Microsoft® Excel for Microsoft 365 MSO (Version 2304 Build 16.0.16327.20200) 64-bit Operating System: Windows 10 pro

I am currently working on an Office Add-in project that involves handling large files, typically in the range of 40 to 50 MB. As part of our efforts to improve performance and reduce server load, we are considering caching these files locally on the user's machine. This would allow us to retrieve files from the local cache when the user accesses them again, thereby enhancing the user experience.

Our primary objective is to download each file from the server only once and store it locally for future access. However, we have encountered challenges related to accessing the local environment path of the user's system through Office JavaScript (Office.js). We understand that direct access to the local file system is restricted due to security constraints.

We are seeking guidance on how to implement a solution that effectively caches these files locally for subsequent access within the Office Add-in environment. Specifically, we are interested in understanding the best practices and approaches to achieve this goal while complying with the security and privacy requirements of the Office Add-in platform.

Any insights, recommendations, or code samples related to caching files locally using Office.js or associated technologies would be highly appreciated. We are committed to ensuring the best user experience while maintaining the integrity and security of our add-in.

Thank you for your assistance, and we look forward to your guidance on this matter.

SiruiSun-MSFT commented 11 months ago

Hi @shermaro91, Unfortunately, we don't encourage you via Office Add-in environment to cache large files. I'm afraid you may need to use any other method to make it. Thanks!