Reload all or a specific template in production without app restart. #1315

Closed
oolekk opened this Issue Aug 29, 2012 · 2 comments

Comments

Projects
None yet
4 participants
@oolekk

oolekk commented Aug 29, 2012

In production mode, one has to restart the whole app to reload templates, which seems to be an overkill for minor adjustments. Here is a link to the topic at mailinglist: https://groups.google.com/forum/?fromgroups=#!topic/liftweb/oqFNzoA_vs4

@Shadowfiend

This comment has been minimized.

Show comment
Hide comment
@Shadowfiend

Shadowfiend May 13, 2014

Member

This may be best done by a LiftRule that decides whether or not to reload a template, or perhaps globally enables/disables template caching in production.

Member

Shadowfiend commented May 13, 2014

This may be best done by a LiftRule that decides whether or not to reload a template, or perhaps globally enables/disables template caching in production.

@Shadowfiend Shadowfiend added this to the 3.0-M1 milestone May 13, 2014

@farmdawgnation farmdawgnation modified the milestones: 3.0-M2, 3.0-M3 Nov 26, 2014

@Shadowfiend Shadowfiend modified the milestones: 3.0-M3, 3.0-M4 Jan 14, 2015

@fmpwizard fmpwizard modified the milestones: 3.0-M4, 3.0-M6 Mar 22, 2015

@Shadowfiend Shadowfiend modified the milestones: 3.0-M6, 3.0-M7 Jul 26, 2015

@Shadowfiend Shadowfiend modified the milestones: 3.0-M7, 3.1 Nov 30, 2015

@Shadowfiend

This comment has been minimized.

Show comment
Hide comment
@Shadowfiend

Shadowfiend Dec 12, 2016

Member

In fact, I think this should just be a matter of changing the template cache defaulting in production mode in HTTPProvider to happen pre-boot instead of post-boot. We'd need to confirm that pre-boot gives LiftRules a chance to initialize to its default Empty before we check it and set it to Full by default in production mode.

Another option would be to move that defaulting directly into the LiftRules initialization of templateCache, as we do similar mode-based toggling in several places in LiftRules.

Even without this, LiftRules.templateCache can be set to a subclass of InMemoryCache that allows for further customization, and the above defaulting of the cache won't take place in that case. (Even as it stands, the default cache allows for deletions to occur.)

Member

Shadowfiend commented Dec 12, 2016

In fact, I think this should just be a matter of changing the template cache defaulting in production mode in HTTPProvider to happen pre-boot instead of post-boot. We'd need to confirm that pre-boot gives LiftRules a chance to initialize to its default Empty before we check it and set it to Full by default in production mode.

Another option would be to move that defaulting directly into the LiftRules initialization of templateCache, as we do similar mode-based toggling in several places in LiftRules.

Even without this, LiftRules.templateCache can be set to a subclass of InMemoryCache that allows for further customization, and the above defaulting of the cache won't take place in that case. (Even as it stands, the default cache allows for deletions to occur.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment