Speeding up Batch Validate revisited

For topics about current BETA or future releases, including feature requests.
User avatar
roedygr
Rank V - Professional
Rank V - Professional
Posts: 370
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

Re: Speeding up Batch Validate revisited

Post by roedygr » Sun Apr 20, 2014 3:42 pm

A little irony. I just realised I can use almost the exact same logic you are to speed up my HtmlMacros program that prepares my website by expanding macros in it. There is nothing to on a page if it has not changed recently and the macro program has not changed recently, with the exception of pages that contain randomly generated quotations.

User avatar
roedygr
Rank V - Professional
Rank V - Professional
Posts: 370
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

Re: Speeding up Batch Validate revisited

Post by roedygr » Mon Apr 21, 2014 2:27 am

Have you considered the problem of what happens if *.html files are deleted? Ideally, from time to time their cache entries should be deleted or you should clear the entire cache and start over.

If they are recreated, the cache entry will be effectively invalidated, so it more a matter of tidyness.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Speeding up Batch Validate revisited

Post by Albert Wiersch » Mon Apr 21, 2014 8:27 am

roedygr wrote:I know this is still experimental, but pushing it toward wider use ...
It should check at the beginning if the cache dir exists.
If it does not it should complain and/or create it and
complain if the create failed.

Otherwise all your cache entries just quietly go into nul:
Hello,

You can change this line:

Code: Select all

  writeFile($cachefile,'',2); // create an empty file
to this:

Code: Select all

  if writeFile($cachefile,'',2)<0 { // create an empty file
   ProgressMessage('Error writing $cachefile: '+$cachefile,2);
  }
That doesn't explicitly check that the cache folder exists, but it will generate an error for every cache file that encounters an error being written, including when the cache folder doesn't exist.
roedygr wrote:A little irony. I just realised I can use almost the exact same logic you are to speed up my HtmlMacros program that prepares my website by expanding macros in it. There is nothing to on a page if it has not changed recently and the macro program has not changed recently, with the exception of pages that contain randomly generated quotations.
:D
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3242
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Speeding up Batch Validate revisited

Post by Albert Wiersch » Mon Apr 21, 2014 8:39 am

roedygr wrote:Have you considered the problem of what happens if *.html files are deleted? Ideally, from time to time their cache entries should be deleted or you should clear the entire cache and start over.

If they are recreated, the cache entry will be effectively invalidated, so it more a matter of tidyness.
No, I haven't given much thought to that except that it would need to be done manually.

This could be something to consider should more people start using this technique.

One possibility is that you could use the Windows Task Scheduler to schedule a program to run every year (or however often you want) that will delete all the cache files.
Image
Albert Wiersch

Post Reply