Skip to content

Share file caching across markbind instances #138

Description

@nicholaschuayunzhi

try{
self._fileCache[filePath]=self._fileCache[filePath] ?
self._fileCache[filePath] : fs.readFileSync(filePath,'utf8');
}catch(e){

Currently each Parser instance has its own cache. Each Page creates its own parser or markbinder instance and thus the cache is not shared. Considering there is a lot file reuse in Markbind, I feel we should have a common cache to cut down on the IO operations.

I propose having a static instance of file cache for Parser class. Possibly can abstract as its own module?

Things to consider

Not reading from cache when file is changed during live reload.

Related #88

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions