Hi,
First, in response to Nandor's question, I don't think people get bad
images very often. It should only happen when developing problems, and
even then, it is an unusual circumstance. So, cleaning out old images
is usually more of a disk space issue.
The days parameter of remove_stale_images is for the last time the file
was accessed. So you can set --days=21 to remove images which have not
been accessed (by webwork) in the past 3 weeks. Running a cron job to
do that every week will keep the most used images, but keep the whole
cache down to a moderate size (depending on your system). If you give
no arguments, you get a list of the number of images by last access
time.
Next, I don't see any problem with having webwork not cache an image
which produced an error along the way. I haven't examined the code
lately so there might be something I am missing, but I don't forsee any
problems.
I think removing whitespace was done soley to recognize more
combinations of strings which produce the same image. Missed
recognition causes more images to be made, and more stored in the
cache. Changing \s+ to a single space would miss f(x)=y, f(x) = y, f(
x)= y, etc., as being the same. I am sure that there exist two latex
strings which are both legal and differ only in spaces, but produce
different output. But, I doubt they happen naturally in webwork
problems, which is probably what the designers of equationcache were
thinking.
That said, you are right that producing images is fast enough that
maybe we shouldn't worry about it. Or, maybe the regular expression for
removing whitespace could be made fancier. I don't have the TeX book
handy to know exactly what characters are allowed normally in a macro
name, but what about changing the first space after a macro name to an
@, then removing all space so that
cos x y
becomes
cos@xy
John
<| Post or View Comments |>
|