You are not logged in.
Hi Arnaud,
Just checked out the '30 - MVC Server' example along with the MVC secctions in the document, I really like the convention over configuration concepts, which is time saving in coding the program.
I noticed that the view files (.html, .partial, .css, etc) are retrieved from a disk folder. What should I do if I want those files to be loaded from BLOB fields of a DB? Thanks.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Hi,
during my tests I noted that changing the blog.css file (to reduce title and text sizes) nothing changed until kill and run the server runtime again. So I suppose the files are readed on startup and anything stay in ram. reading from inside the database will add no speed, I suppose. Arnaud, is this correct ?
Offline
Hi,
during my tests I noted that changing the blog.css file (to reduce title and text sizes) nothing changed until kill and run the server runtime again. So I suppose the files are readed on startup and anything stay in ram. reading from inside the database will add no speed, I suppose. Arnaud, is this correct ?
I did a quick look, yes, in TMVCViewsMustache.Create() the engine loads all the .html and .partials files into memory. I think it should offer an option to always load the view files from the real source.
I also suggest to add an event so that we can intercept the loading of the view files, something like OnLoadViewFileContent(aViewFileName: string: var aContent: string);
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
Re. the questions raised by delphiancoder (ie. not always loading files from disk), I suggest to add a boolean property to TMVCViewsMustache called CacheFiles, eg:
TMVCViewsMustache.CacheFiles: Boolean
, to indicate if the files should be cached vs. always loading from the disk.
Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.
Offline
AFAIR there is such an option already available.
Try to use the TMVCViewsMustacheParameters.FileTimestampMonitorAfterSeconds property to setup the template caching policy.
Offline