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

Thread: Don't cache app.js in production

  1. #1
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    361
    Answers
    37

    Default Answered: Don't cache app.js in production

    Why is not app.js cached in production mode?

    Bug/feature?

    Thanks / E

  2. You can change the _dc param value or even turn it off using the loader config in app.json. I personally like using the build timestamp so when I deploy a build it will use the same timestamp and when I deploy another build there will be a new timestamp. This is what I have in my app.json:

    Code:
        "loader": {
            "cache": "${build.timestamp}"
        },

  3. #2
    Sencha User
    Join Date
    Jun 2008
    Posts
    242
    Answers
    22

    Default

    What do you mean by cached?

  4. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    Why wouldn't app.js be cached in production?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  5. #4
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    361
    Answers
    37

    Default

    Sorry guys, forgot the word not

    If I reload a built app I get:
    Screen Shot 2015-06-03 at 12.50.09.jpg
    But expects it to be cached.

    Thanks /E (and sorry for the confusion)

  6. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    You can change the _dc param value or even turn it off using the loader config in app.json. I personally like using the build timestamp so when I deploy a build it will use the same timestamp and when I deploy another build there will be a new timestamp. This is what I have in my app.json:

    Code:
        "loader": {
            "cache": "${build.timestamp}"
        },
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  7. #6
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    361
    Answers
    37

    Default

    Great stuff, thanks!

  8. #7
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    361
    Answers
    37

    Default

    Though, doesn't this mean that dev mode won't work?

  9. #8
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    361
    Answers
    37

    Default

    Found the same question here:
    https://www.sencha.com/forum/showthr...92#post1104892

    Solutions seems to be a semi-dirty hack in build.xml.

    Mitchell, any thoughts?

    Thanks / E

  10. #9
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    Default

    I personally turn cache off on my dev and test servers. Pass back Cache-Control or no ETag headers will fix this right away with no application hack. Also, Chrome (not sure if others) have a neat little setting to turn cache off when the dev console is open.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  11. #10
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    361
    Answers
    37

    Default

    That's true, thanks again!

Page 1 of 2 12 LastLast

Similar Threads

  1. Cache manifest error in production
    By abcdef in forum Sencha Touch 2.x: Q&A
    Replies: 30
    Last Post: 27 Jan 2014, 5:19 PM
  2. Production not working: app cache issue
    By abcdef in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 18 Nov 2013, 4:20 PM
  3. Timestamp at the end of CSS and JS url breaking cache in production?
    By lestu in forum Sencha Touch 2.x: Discussion
    Replies: 2
    Last Post: 13 Nov 2012, 5:13 AM
  4. Production build with cache.manifest does not cache images.
    By shwetapande10 in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 25 Jul 2012, 5:19 AM
  5. How to cache remote resouces in production build
    By Ritesh.Chopade in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 10 Jun 2012, 9:37 AM

Tags for this Thread

Posting Permissions

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