A possibly cleaner way would be to have it in your .gitignore at the root level of your repo...
... that way everything's centralized in that one .gitignore. However it's my preferred method to have multiple .gitignore files (like your example above), one in each "empty" directory that I want to have tracked in the repo.
I'd say it boils down to personal preference.
Updated / Extended Answer:
It's been pointed out by @DomStubbs below that it would be cleaner to globally track all .gitignore files with:
If you do that, then you can remove:
Globally tracking all .gitignore files also means that the .gitignore in each "empty" directory should be a blank file, as it effectively turns into a placeholder like the .gitkeep file that @AdrianMacneil mentions in his answer.
So that all said, here's an example of what the "Ignore Cache Files" section of your root-level .gitignore could look like if you used the "empty placeholder .gitkeep/.gitignore" method:
# Track all .gitignore files
!.gitignore # or !.gitkeep if you prefer
# Ignore all cache files
But that's only if you want to 1) explicitly define all "empty" directories that you want to track in the root .gitignore and 2) put a blank placeholder .gitkeep/.gitignore in every "empty" directory.
I think that it's much easier to manage which "empty" directories to track by using the .gitignore that @Doug refers to in the original question. Want to declare a directory as "empty" and ignore its contents? Throw in the .gitignore file. Want to start tracking the contents? Delete the .gitignore file. Want to stop tracking the directory entirely? Delete the .gitignore file and exclude the directory in the root .gitignore file. This is more efficient because there is only ever one point of reference for the tracking state of these "empty" directories.
I have now spent far too much time thinking about this topic. :-) However, I am now much more pleased with the "exclude-everything-but-me .gitignore" method. Thanks, everyone!