no-cache for JavaScript assets as well + small refactoring

Disable cache for JavaScript as well.