C
C
Cat Scientist2016-05-09 17:05:25
Computer networks
Cat Scientist, 2016-05-09 17:05:25

AMD and BEM - will caching help me?

Thinking through the architecture of a new web application, I came up with the idea of ​​using BEM in the context of AMD. Don't ask me why I need this, and why I didn't use WebComponents - that's a completely different story. Let's talk about something else:
The rendering of the template happens on the client. "BEM in the context of AMD" means that the templates for each block and each element are implemented in separate files and loaded into the browser asynchronously. In this case, these files are static and cached.
There are a lot of blocks, and as a result we get a huge number of requests to the server. Will caching static files solve this problem (if you do not consider caching at other levels)? How viable is this idea (the same WebComponents pull the same problem)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2016-05-09
@k12th

It is customary for a production environment to glue and minify static files. Specifically for AMD (which does not look so good compared to competitors) there is r.js .
For completeness, it should be noted that with the advent of the HTTP / 2 era, the situation will change, in the new protocol it is more convenient and faster for the browser to download many small files. But support is not 100% yet, and where it is, it requires HTTPS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question