Expand my Community achievements bar.

SOLVED

Download the page built on EDS

Avatar

Level 3

I see loads of advantages of going for EDS , especially in case of SPA. But, if there is a need to download/make the page accessible when offline, I notice css is getting applied, but JS errors are encountered. Export issues and cors issues are present. Appreciate any suggestions / alternate approaches for this.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Hi @Sahana_S 

When you save a page for offline access, it attempts to save all necessary resources like HTML, CSS, and JavaScript files to function properly offline. EDS relies heavily on JavaScript for rendering content. Without an internet connection, downloaded JS files might not execute properly, leading to broken functionality.

EDS typically serves content dynamically based on user interaction, and crucial assets like JavaScript libraries or configuration files might not be included in the initial page download and If your EDS content is served from a different domain (origin) than your SPA, CORS (Cross-Origin Resource Sharing) restrictions might prevent the browser from downloading assets from the EDS domain.

Approach:
my approach would be to pre-render critical pages on the server-side using SSR (Server-side Rendering) or SSG (Static Site Generation) tools like Gatsby or Next.js. This generates static HTML files that can be downloaded and function offline.

Use EDS for dynamic content updates and retrieval via APIs.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 7

Hi @Sahana_S 

When you save a page for offline access, it attempts to save all necessary resources like HTML, CSS, and JavaScript files to function properly offline. EDS relies heavily on JavaScript for rendering content. Without an internet connection, downloaded JS files might not execute properly, leading to broken functionality.

EDS typically serves content dynamically based on user interaction, and crucial assets like JavaScript libraries or configuration files might not be included in the initial page download and If your EDS content is served from a different domain (origin) than your SPA, CORS (Cross-Origin Resource Sharing) restrictions might prevent the browser from downloading assets from the EDS domain.

Approach:
my approach would be to pre-render critical pages on the server-side using SSR (Server-side Rendering) or SSG (Static Site Generation) tools like Gatsby or Next.js. This generates static HTML files that can be downloaded and function offline.

Use EDS for dynamic content updates and retrieval via APIs.

Avatar

Administrator

@Sahana_S Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni