Задать вопрос

Тел: +7 965 3737 888

422

Просмотров

2

Ответов

Middleware to move tags

This middleware makes the page load faster because it moves all tags <script> to the end of document.

When a tag <script> loads, it blocks parallel loading, so, the best practice is load them after load CSS and images.

To use it, just put in a file and add to your setting MIDDLEWARE_CLASSES.

Вопрос полезен? Да0/Нет0
file_2350.py(1.1Кб)
None

Ответы (2):

Ответpkoch:13.03.2012
Ответ полезен? Да0/Нет0

Careful! You're making various copies of the response's content string! I think you might be trading server performance for client performance.

Wouldn't it be simples/more efficient to have a delayed script tag?

Ответspringlo:04.11.2010
Ответ полезен? Да0/Нет0

我要拜你为师。