-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to turn off template Caching #417
Comments
TemplateEngine implementations perform caching based on whether or not a system property is defined (see CachingTemplateEngine for property name). Also, TemplateEngine implementations have isCachingEnabled() to provide a read-only API view of this property for the TemplateEngine. The `cache` field in CachingTemplateEngine is still initialized even if caching is disable. This was kept to minimized future support for adding a setCachingEnabled(boolean) to TemplateEngines to enable callers to change the caching property during runtime and to avoid having to re-initialized the `cache` field.
TemplateEngine implementations perform caching based on whether or not a system property is defined (see CachingTemplateEngine for property name). Also, TemplateEngine implementations have isCachingEnabled() to provide a read-only API view of this property for the TemplateEngine. The `cache` field in CachingTemplateEngine is still initialized even if caching is disable. This was kept to minimized future support for adding a setCachingEnabled(boolean) to TemplateEngines to enable callers to change the caching property during runtime and to avoid having to re-initialized the `cache` field.
TemplateEngine implementations perform caching based on whether or not a system property is defined (see CachingTemplateEngine for property name). Also, TemplateEngine implementations have isCachingEnabled() to provide a read-only API view of this property for the TemplateEngine. The `cache` field in CachingTemplateEngine is still initialized even if caching is disable. This was kept to minimized future support for adding a setCachingEnabled(boolean) to TemplateEngines to enable callers to change the caching property during runtime and to avoid having to re-initialized the `cache` field.
👍 When do you plan to add it into vertx-web ? |
I wanted this fix before the next release, so I tried to extend HandlebarsTemplateEngineImpl class... It would be good to prefer extension-friendly implementation (for libraries in general) against heavy encapsulation. |
There are a couple of issues here, vertx-web is doing cache as well the engines themselves do cache (some do, some don't) so if we're to work on this we need to decide to whom should be delegate caching (vertx or the engine) my gut feeling says vertx and then we can control the cache as desired by this issue. |
Version
Context
This is a feature request in the area of developer experience.
The minimum cache size for templates (jade, handlebars, etc) is 1, and I haven't been able to find a way to turn the cache off completely.
The implication of this is that there is no way to get into a mode where you can simply edit a template and refresh the browser to see changes. You have to restart the vertx app every time you edit a template in order to see the changes.
The text was updated successfully, but these errors were encountered: