Open jbjonesjr opened 12 years ago
Reproduction steps:
Access http://geo.jbjonesjr.com:8080/geoserver/pdf/info.json , see all outputFormats are available as per the default config file.
Access http://geo.jbjonesjr.com:8080/geoserver/pdf/info.json?app=app1 , see that only a pdf outputFormat is available as per the app1 config file
Access http://geo.jbjonesjr.com:8080/geoserver/pdf/info.json again, and see that still only pdf is available. The last file was incorrectly cached!! This is because the app1 printer object is still set.
Mapfish is a bit too optimistic on it's configuration caching. If you don't specify an app parameter when calling a method, Mapfish will only re-read the config file from disk (slow) if the file has been modified since last read. If you do specify an app param, It resets the cache time and reads the file again (if it has changed). The problem arises if the printer variable has already been set (aka, this is not your first request) and you are requesting the default configuration. The printer property is not reset to be null, therefore meaning no file reloading (a problem if the current printer is for ANOTHER app). Setting printer to be null should fix this, but there is likely a more elegant solution that can reduce some of the code in this process.