django: guidelines for speeding up template rendering performance

前端 未结 4 1778
太阳男子
太阳男子 2020-12-24 08:59

How would I go about speeding up Django template rendering? My template takes about 1-2 seconds or so to render, after the view function fully computes whatever it needs to.

4条回答
  •  余生分开走
    2020-12-24 09:43

    Another trick I found: I had to display an HTML table of 755 rows * 15 columns (filling a total of 11,325 data).

    That page used to delay for about 25/30 seconds loading and then the page was a bit laggy. What I did was setting the table with display:none and after the page was fully loaded, changed the CSS property with JavaScript.

    After all of that, the page is loading in max 6 seconds. I suppose that Django spends much less time rendering non-visible elements.

    I do not know if it only works in my case, but it seems to be.

提交回复
热议问题