html script performance

html script performance

I've seen several old posts about poor html view performance with complex code.  My html view has 1550 lines of code - i suppose that qualifies.  The first time the view loads, it takes around 30 seconds.  After that, with any change in parameters (it's in an iframe to display data based on dropdown criteria), it's near instant with no performance issues.   Any ideas what's going on that first time, and if there's anything I can do to pre-cache it or whatever it's doing?

All the posts I found were from 3-4 years ago, so I don't know if this kind of thing is still a common issue, or if there's some way I can code around it.  Happy to share access to whoever thinks they might be able to help.  The funny thing is, the initial load is mostly blank, as the html parameter hasn't been passed - it skips most of the code via an if statement.  But when a parameter (date) is passed, the bulk of the script executes - and it's near instant.  Is there compiling or caching or something going on?

Any tips or thoughts from the zoho experts?

Thanks...