Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Cache Manifest for Ext JS applications

  1. #1
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    902

    Default Cache Manifest for Ext JS applications

    Is Sencha CMD 5.1.2.52 ready to make Ext JS apps compatible with cache Manifest? I really need to cache app.js in manifest file via Sencha CMD like sencha touch apps does. Any solution to make it works using sencha cmd? Any plan for enable it for Ext JS apps?

    Thanks!
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  2. #2
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    Just configure the following on your app.json file:
    Code:
    {
        //...
        "production": {
            "output": {
                "cache": {
                    "enable": true
                }
            }
        },
        //...
    }
    This will automatically generate a cache.manifest file and reference it in your index.html
    You can use the "appCache" block in app.json to control the contents of this file:
    Code:
    {
        //...
        "appCache": {
            /**
             * List of items in the CACHE MANIFEST section
             */
            "cache": [
                "index.html"
            ],
            /**
             * List of items in the NETWORK section
             */
            "network": [
                "*"
            ],
            /**
             * List of items in the FALLBACK section
             */
            "fallback": []
        },
        //...
    }
    Israel Roldán | Senior Software Engineer (Framework tools)

  3. #3
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default

    Does Ext JS/Cmd handle the details to make this to work with IE9 and IE8? Or it's really just working IE10+?

  4. #4
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    It is just working on IE10+ there's no polifyll for IE9- as the only one that used to exist depended on Google Gears which is now discontinued.
    Israel Roldán | Senior Software Engineer (Framework tools)

  5. #5
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default

    I tried this using production build. I did find a cache.appcache file generated but my index.html was not modified to reference the manifest, and at runtime the browser never ask for cache.appcache, and of course nothing is cached. Any idea?Good reference about the subject -> http://www.html5rocks.com/en/tutoria...cache/beginner

  6. #6
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395

    Default

    In order for this to work, your source html must contain an empty manifest attribute in the root html node:
    Code:
    <!DOCTYPE HTML>
    <html manifest="">
    Sencha Cmd will then complete it on the build output.
    Israel Roldán | Senior Software Engineer (Framework tools)

  7. #7
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default

    Quote Originally Posted by israelroldan View Post
    In order for this to work, your source html must contain an empty manifest attribute in the root html node

    Great, it's working.


    Was this documented somewhere? Should I have received a warning or error, when I enabled caching, but my index.html didn't have that?


    So now, the only thing cached is my index.html. Do I have to manually add all the file generated by the theme that is compiled by the build or we have ways to get this automatically added to the manifest/app.json?


    What is the smaller work/configuration to get everything cached?



    I was some thread mentioning 'delta' file, is that related, what is this about?

  8. #8
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    902

    Default

    I have tryied set this in production config
    Code:
    "production": {
      "loader": {
        "cache": "${build.timestamp}"
    }
    },
    and in cache config added same files
    Code:
    "appCache": {
      /**
       * List of items in the CACHE MANIFEST section
       */
    "cache": [
        "index.html",
        "app.js",
        "otherfile.css"
    ],
      /**
       * List of items in the NETWORK section
       */
    "network": [
        "*"
    ],
      /**
       * List of items in the FALLBACK section
       */
    "fallback": []
    },
    As you can see I have added in production config to cache with the build.timestamp, then files always will have the same _dc parameter. this gives a "timestamp version" for files that will be loaded by microloader.

    Microloader always load the app.js_dc?myBuildTimeStampHere.
    The manifest file is generated perfectly but the manifest file doesn't put the _dc in cached files

    Look:
    Code:
    CACHE MANIFEST
    # f1afc0edff32327fd8488ae7d9b0b04009aacabd
    index.html
    # ad1affd2386307f72733baf29d62bd85332ffc7f
    app.js
    
    
    
    
    FALLBACK:
    
    
    
    
    NETWORK:
    *
    I need Sencha CMD put the _dc in cached files like this or do not load with _dc parameter.

    Code:
    CACHE MANIFEST
    # f1afc0edff32327fd8488ae7d9b0b04009aacabd
    index.html
    # ad1affd2386307f72733baf29d62bd85332ffc7f
    app.js?_dc=theBuildTimestampHere
    
    
    
    
    FALLBACK:
    
    
    
    
    NETWORK:
    *

    Any suggestion to make it automaticaly or tell microloader do not put _dc parameter ?
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  9. #9
    Sencha Premium User SebTardif's Avatar
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default

    The following comment under CACHE MANIFEST: # f1afc0edff32327fd8488ae7d9b0b04009aacabdIs not updated between build for me, which is super huge issue. That make the browser believe nothing changed.I assumed the purpose of this number is to make the browser realize that files have changed. How can I force this number to always change?

  10. #10
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    902

    Default

    I have upgraded Sencha CMD to 6.0.0 and now aditional cache files doesn't add in generated cache.appcache



    Code:
     /**
         * Used to automatically generate cache.manifest (HTML 5 application cache manifest)
         * file when you build.
         */
        "appCache": {
            /**
             * List of items in the CACHE MANIFEST section
             */
            "cache": [
                "index.html",
                "app.js",
                "otherfile.js"
            ],
            /**
             * List of items in the NETWORK section
             */
            "network": [
                "*"
            ],
            /**
             * List of items in the FALLBACK section
             */
            "fallback": []
        },
    cache.appcache doesn't change

    Code:
    CACHE MANIFEST
    # e2919dc0d505d33cb178d04c1398ea4094123371
    index.html
    
    
    
    
    FALLBACK:
    
    
    
    
    NETWORK:
    *
    I want to cache this files
    "index.html", "app.js", "otherfile.js" for classic toolkit and others files to modern

    How to especify diferents cache.appcache for classic and another for modern?
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •