Ramesh Karra wrote: > Hi, > > I have a related question - > > I have a map that has 4 tiles at the top level and more tiles as I zoom > in. Let's say total tiles at all levels is 256. Once all these 256 tiles > are generated, mapserver will just serve these from the cache and will not > generated the same tiles again and again, Am I right? > > If I configure some kind of RAM based file system as the mapserver cache > directory, then all requests will be served from the memory and the > performance would be great. I would appreciate if some one could confirm > that this is the way mapserver works. >
Think of it this way -- if you could guarantee that every map that all your users will view will conform exactly to one of the 256 tiles that you have pre-created, then yes, pre-creating and caching them on the drive or in a ramdisk will improve performance. In real life, however, no one user will ever request a map identical to what some other user has already requested. Each map view will overlap some of the tiles, and hence, will have to be re-created. Not only will they request different areas, they will likely also want to view different layers. There goes all your hard work to waste. There are just too many variables to manage. What you could do is set up some kind of "tolerance" or jitter, store each image's name in a session, check if the next request hasn't changed the layers it is requesting, and if the area it is requesting is within the tolerance, then pick up the image from the tmp file. In reality, it is just not worth it. So, don't worry about performance using this approach. Develop your app, then look at other ways to improve the performance. Search the archives, particularly for emails by "Ed McNierney". You will learn a lot. -- Puneet Kishor
