Skip to main content
1-Visitor
August 25, 2015
Question

Decrease Combined JS file downnload time

  • August 25, 2015
  • 6 replies
  • 4391 views

Hello again everyone ,

I have done some debugging on my PC, and it looks like the Combined.6.0.3-b21.20150715.js file is taking ~20 seconds to download upon initial load. I know that this is more of a platform architecture question, but is it possible to break this file apart and have multiple calls made in parallel to increase performance?

Has anyone had this experience and managed to increase the performance?

    6 replies

    1-Visitor
    August 26, 2015

    This is an item that development is actually looking at to improve.

    1-Visitor
    March 10, 2016

    Hi,

    i have the same issue. The performance ist really bad. We have a couple of customized widgets in our application and the filesize of js and css grows.
    Is it possible minify the files? Some other performance tipps?

    Best regards

    1-Visitor
    March 10, 2016

    Well, dividing the js/css in multiple files will end up on a worst performance, it's better to download one big file than a lot of small ones.

    I don't know, but maybe the server doesn't has compact files enabled, as HTTP servers can serve pages compacted ( zip ) then transfer will be faster.

    Carles.

    5-Regular Member
    March 10, 2016

    Combining Javascript and CSS is standard practice to improve initial download performance. The time cost of separate requests is well beyond any benefit of parallelism or "lazy loading" strategies. Browser thread limits and blocking dependencies make sep. requests even worse. Compression on combined files make it even better.

    The application is the sum of its parts including all widgets, styles, extensions.

    You can avoid making more demands on throughput by avoiding individual widget custom styles, especially when used in repeaters. That is one time where things are downloaded as needed, because it applies to individual elements.

    @Juri : app is a one time download per browser until you clear cache.

    1-Visitor
    March 10, 2016

    Yeah, download time is one thing, performance specialy rendering performance an another. ThingWorx is not a SPA or am i wrong? Then why do i have to handle (and also download) stuff i dont need on one site?

    Are there any tutorials or documents how i can optimize the performance? My aim is to get under 1 second and i'm far away from that. For example i would like to minify my sources at first.

    1-Visitor
    March 10, 2016

    Hi Juri, what's SPA?

    1 second when? first load? you won't get there with Standard TW Mashups, if you need this, you will have to work with TW REST API and build your own Web Interface.

    Carles.

    5-Regular Member
    March 10, 2016

    I agree with Carles- Use the Thingworx API to create a special-purpose SPA (Single Page App) if you have such a performance requirement.

    5-Regular Member
    March 10, 2016

    Depending on server application you are using, there are mechanisms to compress files at the server level. This doesn't help developers who need the uncompressed versions to look at code, but in production environments, it makes a huge difference.

    In Tomcat, this is pretty easy - here is a simple example: How to Compress HTTP responses at the Tomcat level | Jaspersoft Community

    Also, when it comes to Widget Extensions, the JS and CSS files get copied directly from the contributing files into the combined files. So, if you are writing the widget, I would encourage doing a minify of the JS and CSS code to help the overall size. Also, If you see specific areas in the combined js and css files that is large and being contributed from other widgets, I would encourage you to get in contact with the extension Author and let them know that is something they could do as an improvement, which would help the community out in general.

    These are kind of generic suggestions, and are more of a workaround for the problem, but they can make some immediate difference if you are having problems now while Thingworx development works on making this better for the future.

    1-Visitor
    October 7, 2016

    Hi,

    Is it possible to activate cache for this Combined file?

    When I trace the request from my navigator, I see that two HTTP Headers are sent to disable caching:

    • Pragma: "no-cache"
    • Cache-Control: "no-cache"

    In debug mode, It have sense to disable some caching feature, but most of time it cause the very poor performances.

    In production mode, at least CSS, JS and resources resources (png, jpg, gif) should be cached.