I am currently developing a larger application and have a lot of different mobile devices for testing purposes. After making some changes it is required that all test devices have the latest version of my XPages running, and that the clients get the latest version of the frontend libraries (CSJS, CSS, Images, etc.).
Because it is rather annoying to always check whether the browser cache is cleared or not I decided to disable the caching on the domino server directly via a web rule. This works really great and helps a lot during testing and designing.
In this example the caching for databases and their ressources in the folder /dev will be disabled:
1. Create a web rule for your Internet Sites
2. Set the type of the rule to „HTTP response headers“
3. Fill in incoming pattern to /dev/*
4. For the „Expires header“ select „Always add header“ and set it to a date in the past
5. Add two custom headers and check the „override“ option:
- Cache-Control: no-cache
- Pragma: no-cache
6. Open the admin console and refresh the HTTP task:
tell http refresh
From now on the headers are always added and will force the browsers to reload the resource every time. Every ressource delivered by the domino server which is inside the /dev folder (contained in a databases) won’t be cached anymore. It works even for minimized libraries and SSL.