Announcement

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

    Best Practice: Serverside cache of DSResponse for static data?

    Hi Isomorphic,

    I have a few configuration tables in my DB that will hardly ever change. If they change, this is always in connection with a new war/undeploy/deploy-powercycle.

    Is there some way right now to have a "SELECT <field_list> FROM <not_changing_table> WHERE ('1' = '1')" and cache that result in order reuse it or - even better - to query it again (from RAM) with Criteria?
    I know there is an application object in .NET (most likely ServletContext in the Java world), where I could implement storage of DSResponse myself, but of course it would be better to use SmartGWT built-in ways of doing so if they exist.

    What is the suggested best practice here?

    Thank you & Best regards,
    Blama

    #2
    A simple approach is to generate a static data file at build time and use it with a clientOnly DataSource. Then the application server does zero work at runtime since the file can be served by a plain web server or CDN.

    If that's not feasible, just cache the results in a static variable and return that from a DMI.

    Comment

    Working...
    X