[Fontconfig] Possible Optimization

Steve Hanov steve.hanov at gmail.com
Tue Sep 9 07:09:19 PDT 2008


Possible optimization

Hi!

I'm using a CGI program that includes fontconfig. (
http://www.websequencediagrams.com). I noticed that when I ran my program
from the command line, it was taking 0.025 s to run. However, when apache2
ran it, it took about 1.5 seconds every time. This is even after running
'fc-cache -f' as root.

The culprit was fontconfig. In the /etc/fonts/fonts.conf supplied with
Ubuntu 7.04, we have:

<cachedir>/var/cache/fontconfig</cachedir>
<cachedir>~/.fontconfig</cachedir>

When run by the www-data user (as a cgi-script), there is no ~/.fontconfig,
so it was regenerating the cache each time.

Executing "chmod a+w -R /var/cache/fontconfig" solved the problem. Now
fontconfig is fast even when executed by a cgi program.

I'm trying to understand what is happening here. Why can fontconfig only use
the /var/cache/fontconfig folder if it is writable? And why does it
regenerate the cache every time, even after fc-cache is run?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/fontconfig/attachments/20080909/6d4aed64/attachment.htm 


More information about the Fontconfig mailing list