What we're doing now is executing a query to get N (default 10) random FIDs and then calling fontyourface_get_font() N times, which results in 2*N+1 queries total (other N being done by fontyourface_add_font_tags()).
This is sort of redundant as we're not using those tags anyway. By getting the stuff ourselves, we could reduce db operations to one query.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | random_fonts-Refactor_to_skip_fontyourface_get_font-1873764-1.patch | 1.38 KB | Drave Robber |
Comments
Comment #1
Drave Robber commentedAnyone wants to take a look at the attached patch? ;)
Comment #2
sreynen commentedWe should probably have more flexible ways to load fonts in fontyourface, so this kind of thing isn't necessary. But until then, this seems like a good solution.
Comment #3
Drave Robber commentedCommitted.