Stop Opera mobile caching javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mwk24
    New Member
    • Nov 2007
    • 2

    Stop Opera mobile caching javascript

    Hi all,
    I have standard AJAX script that calls a php file to load the latest information and uses xmlHTTP.respons eText to write it to innerHTML of a div by id. It works fine on IE/firefox, but I'm having trouble with Opera Mobile, due to javascript caching (at least that is my suspicion)

    I installed Opera for Windows and had the same problem (described below), until I set the Other Modification setting to 0 in opera.ini (i.e. to set Opera to always run the script). However, this setting doesn't exist in Opera Mobile, and thus I need another solution.

    The problem:
    The first time the call is made (triggered by onClick), the correct data is returned. However, every subsequent click (which always calls the same function) just returns the same data, and very quickly. This makes me think that it is not calling the php file, just loading the variable or similar from cache.

    The question:
    What methods can I use to stop Opera Mobile caching the javascript? (i can post code if necessary, but I feel like there should be a generic solution)
    Or is there a better browser solution?

    Thanks!
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by mwk24
    Hi all,
    I have standard AJAX script that calls a php file to load the latest information and uses xmlHTTP.respons eText to write it to innerHTML of a div by id. It works fine on IE/firefox, but I'm having trouble with Opera Mobile, due to javascript caching (at least that is my suspicion)

    I installed Opera for Windows and had the same problem (described below), until I set the Other Modification setting to 0 in opera.ini (i.e. to set Opera to always run the script). However, this setting doesn't exist in Opera Mobile, and thus I need another solution.

    The problem:
    The first time the call is made (triggered by onClick), the correct data is returned. However, every subsequent click (which always calls the same function) just returns the same data, and very quickly. This makes me think that it is not calling the php file, just loading the variable or similar from cache.

    The question:
    What methods can I use to stop Opera Mobile caching the javascript? (i can post code if necessary, but I feel like there should be a generic solution)
    Or is there a better browser solution?

    Thanks!
    A naive approach is to try Tweaking your cache settings and saving space. Ideally you would be doing this in code so you can revert back the cache settings when that page is closed.

    Comment

    Working...