Ticket #1276 (new enhancement)

Opened 8 years ago

Last modified 4 years ago

caching in HTTP POST mode

Reported by: bartvde@… Owned by: mapserverbugs
Priority: high Milestone: 6.0 release
Component: WFS Client Version: 4.4
Severity: minor Keywords:
Cc:

Description (last modified by dmorissette) (diff)

I just noticed something strange using Mapserver WFS client.

If I use HTTP GET for communicating with the Mapserver WFS, then
requesting the same map again does not result in a new GML file being
downloaded (ie read from cache).

But using HTTP POST everytime a new GML file is downloaded for the same
extent.

Change History

Changed 8 years ago by assefa

I did discuss this issues with Daniel although I do not remeber the detilas on 
the implementation we discussed. Looking into the code to update this bug, I 
realized that the the caching we are doing for the get request could be 
applied for the post request as well :
 - for the get request the caching is done using the hashing function on the 
URL (which contains all the parameters) and creating a unique file name base 
on that.

 - for the post request, we can also use the URL + the post request xml and do 
the hash on it and It should create a unique file name. 

 I have just tried it locally and It seems to work ok.  

 I did not commit it yet since It seems too easy as a fix and I might have 
overlooked something.  Daniel do you see any flaws ?

Changed 8 years ago by dmorissette

You also need a file associated with each cached item that contains the full
text data of the request: URL + POST body because the hash value is not
guaranteed to be unique. This file could be called <hash_value>.gml.req for
instance. This is also a flaw of the current GET implementation.

Then when time comes to look in the cache, if you find that a file with the hash
value already exists in the cache, you should open that file, and compare the
request data (URL + POST) and if it's identical then you have a match. If it's
not identical then you have to create a new unique name using something like
<hash_value>+timestamp+pid.* for instance.

Changed 8 years ago by assefa

Damn! I knew it could not be that easy :) I remember now our discussions. 
Daniel thanks for clarifying this. I will make the changes before the next 
release.

Changed 8 years ago by dmorissette

  • milestone set to 4.6 release

Changed 8 years ago by bartvde@…

Assefa, any news on this? Or should we move target to FUTURE?

Changed 6 years ago by dmorissette

  • description modified (diff)
  • milestone changed from 5.0 release to 5.2 release

Changed 5 years ago by dmorissette

  • milestone changed from 5.2 release to 5.4 release

Changed 4 years ago by dmorissette

  • milestone changed from 5.4 release to 6.0 release
Note: See TracTickets for help on using tickets.