Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Clear cache with new versions

    Every time I deploy a new version of my code, I have to let the users clear their browsers cache.

    But is this really necessary? Would not something like the following work?

    Code:
    <script type="text/javascript" language="javascript" src="zedes2/sc/initsc.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_Core.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_Foundation.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_Containers.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_Grids.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_Forms.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_RichTextEditor.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_Calendar.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/modules/ISC_DataBinding.js?version=1.2.8"></script> 
    	<script type="text/javascript" language="javascript" src="zedes2/sc/skins/EnterpriseBlue/load_skin.js?version=1.2.8"></script> 
    
    <script src="zedes2/sc/DataSourceLoader?version=1.2.8&dataSource=schuelerSimple"></script>
    I put the version of my application in every javascript/css file. Even the DataSourceLoader.

    This seems to work. Am I missing something?
    Would this prevent the users to have to clear their cache when a new version is deployed?

    Using smartGWT 4.1p power.

    #2
    I do the same &version parameter when loading scripts in the host HTML page. But there is still a problem with the host HTML page itself. As long as it exists in browser cache, the &version trick is usless.
    I am not sure but mayby putting in host page:
    <meta http-equiv="pragma" content="no-cache">
    would help? Is it right approach?
    MichalG

    Comment


      #3
      Interesting. I will put

      <meta http-equiv="cache-control" content="no-cache" />

      in the HTML page in order to avoid this. But wouldn't this prevent the cache of the smartGWT libraries to work ?

      Isomorphic, is this the right approach?

      Comment


        #4
        That, or any other approach to prevent caching, such as adding the version as a path segment - this isn't really specific to SmartGWT.

        Generally the bootstrap .html file should not be allowed to be cached or users will end up downloading mixed versions.

        Comment

        Working...
        X