Giter VIP home page Giter VIP logo

Comments (4)

diegonvs avatar diegonvs commented on May 26, 2024

Hello Stan! Thanks for collaborating filling this issue :)

How are you using senna App? You are extending senna App?

from senna.js.

Aurugorn avatar Aurugorn commented on May 26, 2024

Thanks for the quick response!
Currently using it with turbolinks. Just adding senna-surface etc. as tags. It works perfectly! But my pages must be up to date always (for example I have a page with a schedule that can be updated any time).
Thanks in advance for helping!

EDIT:
Found app.clearScreensCache(); is something. Not sure how to implement this in my situation.
Because I want to clear cache on every page navigation. (So basically I never want to cache any page).
Couldn't find an easy option to turn it off.
Let me know if this is possible!

EDIT 2:
I've found that if you edit a value in senna-debug.js on line 8683 to false. It would not cache any pages.
_this.cacheable = false;
Not sure if this is the best option? Since now Senna is creating new screens for every page navigation, in stead of deleting the old screen and creating a new one.
Let me know if there is an auto-delete screen if cache does not match up to date page (cache invalidation)

from senna.js.

lneves12 avatar lneves12 commented on May 26, 2024

Hi @Aurugorn,

I had the same problem as you.
You can have a bit more control of your cache like this:

import App, {HtmlScreen} from "senna";

var appInstance = new App();
appInstance.setLinkSelector("a.js-spa");
appInstance.setFormSelector("");
appInstance.addSurfaces('page-body');
appInstance.addRoutes([{
    path: /.*/,
    handler: function (route) {
        const screen = new HtmlScreen();
        screen.setCacheable(false);
        return screen;
    }
}]);

from senna.js.

jbalsas avatar jbalsas commented on May 26, 2024

Closing based on the provided workaround. Please, feel free to reopen if still need something else!

from senna.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.