Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Optimize the preview and source code views #150

Open
pestevez opened this issue Feb 12, 2021 · 0 comments
Open

Optimize the preview and source code views #150

pestevez opened this issue Feb 12, 2021 · 0 comments

Comments

@pestevez
Copy link
Contributor

The current implementation of the builder uses a PHP webserver installed locally. This server receives two requests:

  1. Generate the IA markup of a given URL, which is used for the Source tab.
  2. Generate the Preview of the Instant Article crated for the given URL and the template defined in the builder, which is the one used for the Preview tab.

Each time the user switches tabs, a new call is made to the webserver and the corresponding transformations are ran, regardless of presence of new changes. This causes some performance issues, which will be exacerbated if we keep adding tabs or other functionality that relies on the webserver (like the one describes in #149).

We should look for ways to optimize this functionality, perhaps using some sort of cache (either on the webserver or on the client).

We have a few challenges that we need to account for:

  1. The Source view leverages the browser's view-source:{URL} to format the markup.
  2. The Preview tab relies on a given URL returning a web page.
  3. If we were to use a single API call to receive multiple elements (IA markup, HTML markup of the preview, SDK warnings, etc.) we will have to escape the HTML contents.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant