#497

Check if caching is enabled before serving a page from the cache
#497

fix possible race conditions
Fix cachefilename for news categories
variables declared global are always "set"
comment handling cleanup
fix #497
Merge remote-tracking branch 'origin/Static-Cache'
fix #505, fix #504
Merge remote-tracking branch 'origin/master' into 1.4.6