Speeding up Batch Validate revisited
- 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
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.
- 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
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.
If they are recreated, the cache entry will be effectively invalidated, so it more a matter of tidyness.
- 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
Hello,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:
You can change this line:
Code: Select all
writeFile($cachefile,'',2); // create an empty file
Code: Select all
if writeFile($cachefile,'',2)<0 { // create an empty file
ProgressMessage('Error writing $cachefile: '+$cachefile,2);
}
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.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
- 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
No, I haven't given much thought to that except that it would need to be done manually.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.
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