Speeding up Batch Validate revisited

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

Re: Speeding up Batch Validate revisited

Post by roedygr »

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
Posts: 367
Joined: Fri Feb 17, 2006 5:22 am
Location: Victoria BC Canada
Contact:

Re: Speeding up Batch Validate revisited

Post by roedygr »

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
Posts: 3783
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Speeding up Batch Validate revisited

Post by Albert Wiersch »

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
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
Albert Wiersch
Site Admin
Posts: 3783
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Speeding up Batch Validate revisited

Post by Albert Wiersch »

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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Post Reply