locked
Slow page loading in LightSwitch html application RRS feed

  • Question

  • I'm developing an application with around 30 entities.

    Recently, after hosting the application in Azure, I've started facing a very slow response times on hitting pages.

    After checking what slows the app down, I've conclude that the model.json got very big 2MB of code and since it isn't cached, it is loaded and parsed on each page load. It can take about 10 seconds delay, because of that.

    The question is, is there a way to tell LightSwitch to cache this model.json data and not load it again and again from the server?

    Thanks in advance friends!

    Tuesday, February 23, 2016 8:47 PM

Answers

    • Proposed as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    • Marked as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    Wednesday, February 24, 2016 11:34 PM
  • Another thing you can check is the network traffic in Chrome Developer Tools (Ctrl-Shift-I) while opening the slow page to determine which network call is causing the delay or perhaps there are simply too many calls being made. Once you've identified the offending network call or query you should be able to investigate the cause of that particular one.

    You could even be able to right-click on that call and open it as a URL into a new browser tab so you can easily repeat the call by refreshing that new browser tab.


    Regards, Xander. My Blog

    • Proposed as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    • Marked as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    Thursday, February 25, 2016 2:06 AM

All replies

  • There 2MB sounds really large even for 30 entities but I;m surprised that is get's downloaded more than once per session.  Are you saying you see this delay on every screen transition or just once when app/page loads?

    Hopefully you're on VS 2013 or laster since the JSON lite made the big perf boost.

    First check this:

    https://msdn.microsoft.com/en-us/library/mt146803.aspx

    Also, there is a known issue with summary controls needlessly growing your model, you could check this:

    https://gallery.technet.microsoft.com/scriptcenter/How-To-Trim-your-9305daf6

    HTH,

    Josh

    Tuesday, February 23, 2016 9:59 PM
  • Yes. I'm using VS 2013.

     The model.json file is only loaded if I do a page refresh or at the first hit to the page.

    If I pass from one screen to the other, it is not loaded.

    Anyway, I'm started to think this is not the problem.

    Thanks for the links!

    Wednesday, February 24, 2016 11:56 AM
    • Proposed as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    • Marked as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    Wednesday, February 24, 2016 11:34 PM
  • Another thing you can check is the network traffic in Chrome Developer Tools (Ctrl-Shift-I) while opening the slow page to determine which network call is causing the delay or perhaps there are simply too many calls being made. Once you've identified the offending network call or query you should be able to investigate the cause of that particular one.

    You could even be able to right-click on that call and open it as a URL into a new browser tab so you can easily repeat the call by refreshing that new browser tab.


    Regards, Xander. My Blog

    • Proposed as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    • Marked as answer by Angie Xu Sunday, March 6, 2016 1:32 PM
    Thursday, February 25, 2016 2:06 AM