Port Icewind's fix I
Cache: fix property path for getting legacy etag
Adjust to Icewind's fix
Add PHPDoc
Only prepare an SQL statement once.