MapServer / mapcache

MapCache source code directory. Please submit pull requests to the 'main' branch.
https://mapserver.org/mapcache
Other
131 stars 96 forks source link

Allow for fixed date/time expires settings in mapcache #5

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: rdewit Date: 2011/10/10 - 08:38 Currently and are set in seconds after tile creation.

Sometimes it can be useful to set the expires value to a fixed point in time, for example when creating caches of weather forecasts that renew every hour on the hour.

Note: Ideally it would be possible to use a cron-like syntax for automatically updating the and values, but that is out of scope for this ticket.

tbonfort commented 12 years ago

Date: 2011/10/10 - 08:46 What about an expiry time in seconds after tile creation, but rounded to the nearest/lower/upper time resolution ?

eg: all tiles created from 10:00:00 to 10:59:59 expire at 11:00:00

tbonfort commented 12 years ago

Author: rdewit Date: 2011/10/10 - 09:14 I like the idea, but would that work if some layers would be updated by the hour, some every day and some 2x per month?

How would you define what the time resolution looks like?

tbonfort commented 12 years ago

Date: 2011/10/11 - 09:51 You're right, the resolution used should be configurable, to be able to specify the recurrence in hours,days,weeks, months,...

2x per month is going to be problematic, as I have found no simple api/library that lets you add half a month to a timestamp.

Adding a simple timestamp to the expires configuration is not very involved, the configuration of could be changed to something like:

#!xml
<expires>
  <timestamp>2011/12/16 20:00:00</timestamp>
</expires>

or

#!xml
<expires> <!-- relative to access time -->
  <access>
     <hours>1</hours>
     <minutes>30</minutes>
  </access>
</expires>

or

#!xml
<expires> <!-- relative to tile modification time -->
  <mtime>
     <hours>1</hours>
     <minutes>30</minutes>
  </mtime>
</expires>

the actual number would be mapped to

#!xml
<expires>
  <access>
     <seconds>number</seconds>
  </access>
</expires>

Recurring expiration would be more involved, and would need discussion as to what features to provide, and what syntax would be used for configuration.

tbonfort commented 12 years ago

Author: rdewit Date: 2011/10/13 - 08:39 For my use case, the timestamp option for both and maybe also would be sufficient: the server just needs to inform the browser until when a set of images can be cached locally on the client.

eva-j commented 9 years ago

Hi, I'd like to ask - is this issue somehow in progress? I would really appreciate the possibility to use timestamp in my cache...

tbonfort commented 9 years ago

@evka1410 there is no current work ongoing for this. I can however be contracted to do it if you are willing to pay for it.