smoothState not to cache my pages

273 Views Asked by At

Is there a way of not having smoothState cache my pages? I am developing a large news site and since content is added on a daily basis people need to press F5 on all of the pages to view the new content and updated sitebars...

Can I just set cacheLength to 0 or would that beat the point of the entire script?

New to smoothState so this is what I have in my main:

My main.js file

$(function(){
  'use strict';
  var $page = $('#main'),
      options = {
        debug: true,
        prefetch: true,
        cacheLength: 4,
        onStart: {
          duration: 350, // Duration of our animation
          render: function ($container) {
            // Add your CSS animation reversing class
            $container.addClass('is-exiting');
            // Restart your animation
            smoothState.restartCSSAnimations();
          }
        },
        onReady: {
          duration: 0,
          render: function ($container, $newContent) {
            // Remove your CSS animation reversing class
            $container.removeClass('is-exiting');
            // Inject the new content
            $container.html($newContent);
          }
        }
      },
      smoothState = $page.smoothState(options).data('smoothState');
});
0

There are 0 best solutions below