From a2e35a5d97d754b650bf516adff24788039a904b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 9 Jan 2016 20:09:43 +0100 Subject: [PATCH] Fixing concept changes (resource versioning) --- caching,_sessions,_local_storage_&_cookies.md | 4 ++-- modules.md | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/caching,_sessions,_local_storage_&_cookies.md b/caching,_sessions,_local_storage_&_cookies.md index f4fe085..6b56cf6 100644 --- a/caching,_sessions,_local_storage_&_cookies.md +++ b/caching,_sessions,_local_storage_&_cookies.md @@ -14,12 +14,12 @@ Example usage for 30 days caching: $resposne->setHeader('Cache-Control', 'Cache-Control: max-age=2592000'); ``` -In order to trigger a re-cache of stylesheets or javascript files make sure to include their version hash as file name. This way version updates will result in a new file name and will be re-cached by the client browser. +In order to trigger a re-cache of stylesheets or javascript files make sure to update the version in the `Controller.php` file. This way version updates will result in a new virtual file uri and result in a re-cache. Example usage: ``` -$head->addAsset(AssetType::JS, $request->getUri()->getBase() . 'Modules/Media/ModuleMedia_' . self::$version . '.js'); +$head->addAsset(AssetType::JS, $request->getUri()->getBase() . 'Modules/Media/ModuleMedia.js?v=' . self::MODULE_VERSION); ``` ## Sessions diff --git a/modules.md b/modules.md index 0c82335..00d5856 100644 --- a/modules.md +++ b/modules.md @@ -2,7 +2,7 @@ The following directory structure should roughly visualize how modules are strucured. The purpose of the different sub-directories and their files will be covered in the following sections. -* UniqueModuleName +* {UniqueModuleName} * Admin * Install * Navigation.install.json @@ -35,7 +35,7 @@ The following directory structure should roughly visualize how modules are struc * YourJavaScriptViews.js * Controller.php * Controller.js - * ModuleUniqueModuleName_1.0.0.js + * Module{UniqueModuleName}.js * info.json All modules are located inside the `/Modules` directory and their directory name has to be the module name itself without whitespaces. @@ -123,7 +123,7 @@ The Theme directory contains the current theme for every page this module suppor ### Css -Every page has its own CSS directory. This application only allows the use of SASS/SCSS as preprocessor. All sass/scss files need to be provided as well as the processed CSS files. Make sure to include the version number in the CSS file name for overwriting the cache on updates. CSS files need to be minimized and if it makes sense concatenated. +Every page has its own CSS directory. This application only allows the use of SASS/SCSS as preprocessor. All sass/scss files need to be provided as well as the processed CSS files. Make sure to update the version number in the `Controller.php` file. CSS files need to be minimized and if it makes sense concatenated. ### Img @@ -135,13 +135,14 @@ The Lang directory contains all language files for this application. Usually the A language file should have the following naming convention: - {ISO 639-1}.lang.php + {ISO 639-1}.lang.php + {UniqueModuleName}.{ISO 639-1}.lang.php The content of the language file is straight forward: ``` 'Your localized string', ]; ```