hexlet-correction icon indicating copy to clipboard operation
hexlet-correction copied to clipboard

Rework the script connection - use greedy loading

Open fey opened this issue 7 months ago • 1 comments

Problem description

Now the script is connected directly, the version from jsdeliver is loaded and because of this the script is cached by the browser. Now we don't have script versioning, and if we did, every vorkspace admin would have to change the link to the script. Thus, when changing the script, the old version will be pulled to the browser - we will need to reset the cache after updating the code.

Proposed solution

The first thing to do is to study how similar scripts that are embedded on the page work. For example, how the script about Yandex metrics works. image

The script uses the date, maybe some other dates, to embed the required code on the page. We need to do something similar.

Eventually the way the script is connected should change, there will be a script that executes on the user page and embeds the current version of the widget, without caching.

fey avatar Jul 24 '24 14:07 fey