[ticket/12387] Use the hash as query_id for caching

PHPBB3-12387