Prevent SPA View from caching

My first SPA site ever is nearing completion. I am now a believer in routes and SPA methods. My boss likes the idea of animated elements on the pages as well, but as we know the views are cached an the animations only work once.

I am guessing the answer is no, but is there a way to prevent the view caching so that animations will work on every view change?

maybe SPA pages needs to onloaded event for external call js . you can trigger all js when spa page loaded .

if you are using js in SPA project . and if you have server connect on your SPA page(view) you can use onloaded events for call js .

If you use the Inview Animation, there should be no problem
image

See my own site as an example (home page only, no time to do more)

I had in views set up. They only worked sometime and some pages didn’t even load until I started scrolling.

The animation seems to be set only on a single paragraph. What Brad needs to do is animate the page transition. Which does not work with current routing implementation as posted here.

@brad not caching page would defeat the purpose of having an SPA in my understanding. The better solution would be to expose the loadaed event. That would also help us handle multiple other issues we are facing with SPAs too. :sweat_smile:

1 Like

@nshkrsh is correct. I am doing more of a page transition, @ben.

See for example, here is a page I added transitions for that I know doesn’t work. Nothing loads until you scroll.

http://kopar.workbcpg.ca/press

Hey Brad,
Please follow Patrick’s advise to add animations to your SPA:

1 Like

Thanks Teodor, I have done that. But it only animates once the first time the page is visited.

http://kopar.workbcpg.ca/success

Brad, you have applied inview animations through the UI.
Please double check Patrick’s explanation, remove any animation options applied and manually add the classes he mentioned.

Is there a way to slow down the animation?

You can edit the animate CSS file and change the default duration, which if I properly remember is 400ms (not 100% sure about the default duration, on my phone currently) :slight_smile:

1 Like

Thanks for your help, @teodor. I was hoping to be able to animated individual elements but I will settle for full page transitions. Thanks again, much appreciated.

1 Like

Maybe @patrick can improve this in some of the future updates :slight_smile:

1 Like