Get started

A lightweight Javascript that improves the end user experience and offloads servers. It enables decentralized content delivery and smart cache usage.

  • 1.Replace any other lazy loading lib for Greta Lazy Loading
  • 2.Allow Greta to load CORS headers
  • 3.Paste the script into the top of the head tag
  • <html>
    <head>
    <script> setTimeout(function(){var a=window.GretaOptions||{};a.lazyLoad=a.lazyLoad||{};var f=a.lazyLoad.imgAttribute||"data-src",g=a.lazyLoad.bgImgAttribute||"data-bg-src",h="DIV SECTION ARTICLE ASIDE B BODY FIGURE HTML I LI MAIN MARK NAV P SPAN STRONG SUMMARY TABLE TIME UL H1 H2 H3 H4 LABEL".split(" "),e=a.lazyLoad.addClassOnLoad||"",a="boolean"===typeof a.lazyLoad.enable?a.lazyLoad.enable:!0;!window.greta&&a&&setInterval(function(){for(var a,b=document.querySelectorAll("IMG["+f+"]"),c=0;c<b.length;c++)(a=b[c].getAttribute(f))&&b[c].src!==a&&(b[c].src=a,b[c].removeAttribute(f),0<e.length&&(b[c].className+=" "+e));for(c=0;c<h.length;c++)for(var b=document.querySelectorAll(h[c]+"["+g+"]"),d=0;d<b.length;d++)(a=b[d].getAttribute(g))&&b[d].style.backgroundImage!=="url("+a+")"&&(b[d].style.backgroundImage="url("+a+")",b[d].removeAttribute(g),0<e.length&&(b[d].className+=" "+e))},1E3)},1E3); </script><script src="https://cdn.greta.io/greta.min.js"></script>
    </head><body>
    ⌘C

    Customizable

    Greta headless is free to use and you can customize Greta's default settings by adding a GretaOptions object in a script tag placed before the main script.

    (Ex. turning on debug mode to monitor the delivery in the browser console.)

    Learn more
    Found 234 peers
    Connecting to peer
    Connected to peer
    Loading https://url.co/img.jpg from peer
    p2p loaded https://url.co/img.jpg in 430ms, speed: 32132 kbps, size: 2 MB
    p2p sent: 794 KB
    Disconnected from peer
    Loading https://url.co/img.jpg from cache
    Cache loaded https://url.co/img.jpg in 910ms, speed: 197954 kbps, size: 2 MB

    How it works

    As soon as Greta script is loaded onto your site, Greta starts to observe the network by listening in on all ajax/xhr requests. The sooner the script is loaded, the more requests will be analysed by Greta, this is why it's crucial to load Greta script first thing in the <head> tag of your site. The script will then process all requests it can find and find the best ways of where and when to load.

    Find best possible route

    Our algorithms then picks the best candidate between either Greta cache, Greta peer-to-peer network along with all your avilable servers. When calculating the route Greta analyzes your network in real time and combs it using knowledge from all network data going through Greta in order to pick the best option. This results in server offload and faster response times for your users.

    Smarter loading

    Our script is incredibly smart in deciding when to load. Greta operates with automatic lazy loading, which means that Greta will only request assets once they're in the lazy loading scope of the page. This reduces the amount of unneccessary requests as well as increases the user experience of the site.