javascript - Speed up the loading time for html, pdf and txt files within <object> tag -


i have embedded html e-book in object tag can view jq mobile app, been successful problem it's taking average of 40 seconds load, there way can make load faster? below code, further below scripts.

i have tried:

<div data-role="page" data-dom-cache="true"> 

no luck,
appreciated. thank you. code below.

<div data-role="page"> <div data-role"header"></div>        <div data-role="content">       <div data-role="collapsible-set">          <div data-role="collapsible" data-icon="arrow-r">                 <h3>agriculture <img src="images/icons/agriculture.png"                  alt="agripic" id="listicon">                 </h3>                         <ul data-role="listview" data-filter="true">             <li>                         <object data="data/test.html" type="application/html"                              width="100%" height="100%"  data-dom-cache="true">                     <a href="agriculture/agriculture economics/agriculture.htm">agriculture</a>                         </object>            </li>     </div>  <link href="jquery.mobile-1.2.1.min.css" rel="stylesheet" type="text/css"/> <link rel="stylesheet" type="text/css" href="style1.css"> <script src="jquery-1.6.4.min.js" type="text/javascript"></script> <script src="jquery.mobile-1.2.1.min.js" type="text/javascript"></script> <script src="cordova.js"></script> <script src="script.js"></script> 

there various parameters on website optimization depend, can provide few suggestions:--

--> use css library/code or js code in header of webpage

by manner css , javascript speed loaded , rest of web content load, if css code not lengthy, use actual code @ header side beside importing css file location, in importing , parsing remote file take long time speed up.

--> minify javascript, css, , html (in order)

minification process of removing unnecessary whitespace, returns, comments , other characters not necessary functional code. minifiers yui compressor go further abbreviating local variable names one- or two-character names. minified code improves performance downloading faster. minified code requires fewer tcp/ip packets, requires fewer round trips packets, speeding page display. see velocity: tcp , lower bound of web performance steve souders.

--> put javascript below css files

placing javascript files after css files can block css files downloading in parallel. avoid delay, place css files @ top, , javascript files after css or @ bottom of html document.

-->cache resources properly

web caching stores used objects closer client through browser, proxy, or server caches. storing "fresh" objects closer users, avoid round trips origin server, reducing bandwidth consumption, server load, , importantly, latency. many pages out on web have poor caching policies in place, static resources have either no expiry headers set (freshness lifetimes), or short or expired expiry dates. wastes bandwidth on repeat visits , visits interior pages. use long expiration dates static resources, , configure etags properly. see following tutorial how set proper caching policies, set expiration @ least 1 week (some webmasters use years) localize external resources more details.

--> object/flash part of webpage

it media content, , can in large size file, best way use customize header expiry/caching, in load big amount of cache on user side or provide valid expiration, in future load content fast.

for more see below reference :--

reference 1

reference 2


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -