Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having trouble with my web-based application, where my tmp images are not being stored for later retrieval. The images are generated each time they have to be loaded, so zooming out and then back in to the same location requires mapserv.exe to re-generate the tiles for that view.

The application lives here:

A sample map file snippet is below:

    OUTPUTFORMAT                                        #-> BEGIN OUTPUT FORMATTING DEFINITION
        NAME "png"                                      # Name of format
        DRIVER AGG/PNG                                  # Image driver
        MIMETYPE "image/png"                            # Type of image
        IMAGEMODE RGBA                                  # Image mode
        EXTENSION "png"                                 # Image filetype
        TRANSPARENT ON                                  # Transparency
    END                                                 #-> END OUTPUT FORMATTING DEFINITION

    WEB                                                 #-> BEGIN WEB DEFINITION
        IMAGEPATH "/ms4w/tmp/ms_tmp/"
        IMAGEURL "/ms_tmp/"
    END                                                 #-> END WEB DEFINITION

The web page's source will show the OpenLayers init code, but I've pasted some sample layer init code below:

hii_1 = new OpenLayers.Layer.MapServer("Land Cover","../../cgi-bin/mapserv.exe",{

Any ideas?

share|improve this question
up vote 4 down vote accepted

The temp files are automatically deleted by MapServer. If you want to cache generated images you should look at something like TileCache, MapProxy, or the MapServer's new MapCache.

Update - after requiring this myself, it is possible to force MapServer to save the images to file on the server. You need to use the CGI parameter mode=browse. See for all CGI parameters. The image will then be saved to IMAGEPATH.

Also make sure the MAP STATUS is set to ON.

share|improve this answer
thanks. learn something new everyday! would you recomend one over the other? I have 6 geotiff files being rendered by mapserver that are 65mb each. as far as raster optimization goes, they are tiled, 8bit and projected correctly. cheers. – Michael Markieta Jan 18 '12 at 6:25
@MichaelMarkieta - looks like I was wrong about MapServer not saving to file - you can force this mode if you wish – geographika Dec 17 '14 at 20:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.