NetTalk Central

Author Topic: Slow loading JS  (Read 3262 times)

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Slow loading JS
« on: April 18, 2014, 11:56:07 AM »
I have web app with javascript. My problem is very slow loading or even not loading some of javascripts.

I am using firebug to analyze my pages and it have problem with different scripts which are not necessary big, few Kb.

How to solve this problem?

Best regards,

Djordje Radovanovic


Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Slow loading JS
« Reply #1 on: April 19, 2014, 01:22:31 AM »
Sorry. Clarion 9.1 NetTalk 8.08.

Regards,

Djole

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Slow loading JS
« Reply #2 on: April 19, 2014, 05:38:58 AM »
try tweaking the Performance settings. I suspect if there is a problem it's related to one of them.
Keep-Alive, Auto-check cache and the cache itself would be my prime candidates.
If you figure out what combination _causes_ the problem please let me know.

cheers
Bruce

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Slow loading JS
« Reply #3 on: April 20, 2014, 10:45:01 AM »
Obviously it needs some tweaking. I load several .js files into one combine file like ALL.JS is but one need to take care of order of files in that new combine file. If you put them in wrong order "Microsoft Script" executor could die. Many file on one page could be problem for NetTalk.

Then, of course I .GZIP it. It gives application much more stability and make pages snapier.

After that I tried to include those files in application scripts instead for individual page but it does not improve loading pages.  I played with option "Suppress CacheCheck for this file" which add to request ?c=1 like ALL.JS, but gain nothing. It even makes them slower cause it is now loading for every page.

Maybe some more finding will come but it would be nice for all of us who are scratching this new environment to share experience. So, come on, join me.

Best regards,

Djordje Radovanovic





trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Slow loading JS
« Reply #4 on: April 21, 2014, 07:40:19 PM »
Hi Djordje,

I had exactly the same issue as you where my login page was taking 30 seconds to load. After changing the settings on the performance tab, these are the settings that fixed the long loading time for me on 2x nettalk apps:

- Combine common files = true
- Serve pre-compressed = true
- Compress static files = true
- Compress dynamic files = true
- Auto-check cached files = true
- Front loaded = false
- Allow Keep-Alive = false
- Enable File Cache = false
- No JavaScript check = true
- No Screensize check = true

As fast as a speeding bullet now! Hope that helps.

Regards,
Trent

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Slow loading JS
« Reply #5 on: April 22, 2014, 05:46:21 AM »
Thank you Trent.

I already make my page fast as possible but your settings can be valuable for all of programmers that doing it first time.

Best regards,

Djordje Radovanovic

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Slow loading JS
« Reply #6 on: April 24, 2014, 01:45:44 AM »
>> My problem is very slow loading or even not loading some of JavaScripts.

I think this is fixed in 8.10. Robert found a specific combination which caused a problem.

>> I played with option Auto-check cached files which add to request ?c=1 like ALL.JS, but gain nothing. It even makes them slower cause it is now loading for every page.

Slower - sort of. The check polls the server to see if the file has changed, but the server sends back a simple 304 (not modified) answer if the file in the cache is up to date. So it is slower yes, because it makes the request, but it's not the same as fetching the whole file again.

Usually this can be turned off after you've deployed your site update for a while. Leave it on for the first few days or so after updating the site.

Cheers
Bruce

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Slow loading JS
« Reply #7 on: May 21, 2014, 07:19:57 AM »
This time JavaScript is not a problem. Now I am playing with css. As I am combining several .css files to achieve  beautifying. I'd like to not have them in one file as all.css is. It is easier to me to leave them in original files till I found my best options.
If I leave them in original files and including .js files I have more than 10 files in a header of page. Loading page with this options always stack on some of those small files and page is loading for a several minutes.

I know that if I optimize loading it will not happen, but now I am in developing mode and I need them like this. Does one know what is going on with server in this situation and how can I avoid this slow loading?

I am using Clarion 9.1 and NetTalk 8.12.

Best regards,

Djordje Radovanovic


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Slow loading JS
« Reply #8 on: May 21, 2014, 08:16:48 AM »
turn off "auto-check cache" and press Ctrl-F5 in the browser when you want to refresh the CSS files.

cheers
Bruce

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Re: Slow loading JS
« Reply #9 on: May 21, 2014, 02:49:47 PM »
I have to push Ctrl-F5 every now and than but it is acceptable during developing process.

Thank you again Bruce.

Best regards,

Djordje Radovanovic