[Geoserver-users] Terminate GeoWebCache REST API Request

In my web application, i wanted a service to cache updated data using
geowebche. so i worked on seeding tiles automatically with GeoWebCache as in
this post:
http://gis.stackexchange.com/questions/87728/custom-time-interval-for-geowebcache/87804#87804

I see that the "Disk Used" of the layer in "Tile Caching" has been increased
to 50 MB. i also replaced wms with gwc/service/wms in layer requesting in
OpenLayers.

My data is updating every 2 hours. So i thought i have to terminate the
request and create a new one every 2 hours. "scheduled task"

I tried this kill request:

curl -v -u geowebcache:secured -d "kill_all=all"
"http://localhost:8080/geowebcache/rest/seed/workspace:layer.xml"

as in the last section here http://geowebcache.org/docs/1.5.1/rest/seed.html

but the "Disk Used" size hasn't changed! and the cached data still the old
data. here is the response:

* About to connect() to 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1... connected
* Server auth using Basic with user 'admin'

POST /geoserver/gwc/rest/seed/workspace:layer.xml HTTP/1.1
Authorization: Basic YWRtaW46Z2Vvc2VydmVy
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1
zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Host: 127.0.0.1:8080
Accept: */*
Content-Length: 12
Content-Type: application/x-www-form-urlencoded

* upload completely sent off: 12out of 12 bytes
< HTTP/1.1 500 Internal Server Error
< Server: Apache-Coyote/1.1
< Transfer-Encoding: chunked
< Date: Wed, 30 Apr 2014 10:31:28 GMT
< Connection: close
<
* Closing connection #0
: Premature end of file.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Shadin,
Are you sure you want to be using tiles when the data updates every two hours? That seems like massive overkill unless you’re running a service with absolutely loads of users and usage (and even then…).
Tiles are best used for baselayers that change rarely (i.e. OpenStreetMap, google maps)

You may be better served simply setting the Response Cache Headers timeout to 2hrs (7200 seconds) on whatever layers you require it for.

http://docs.geoserver.org/stable/en/user/webadmin/data/layers.html

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

Cheers,
Jonathan

On 30 April 2014 12:09, Shadin <shadin__a@anonymised.com> wrote:

In my web application, i wanted a service to cache updated data using
geowebche. so i worked on seeding tiles automatically with GeoWebCache as in
this post:
http://gis.stackexchange.com/questions/87728/custom-time-interval-for-geowebcache/87804#87804

I see that the “Disk Used” of the layer in “Tile Caching” has been increased
to 50 MB. i also replaced wms with gwc/service/wms in layer requesting in
OpenLayers.

My data is updating every 2 hours. So i thought i have to terminate the
request and create a new one every 2 hours. “scheduled task”

I tried this kill request:

curl -v -u geowebcache:secured -d “kill_all=all”
http://localhost:8080/geowebcache/rest/seed/workspace:layer.xml

as in the last section here http://geowebcache.org/docs/1.5.1/rest/seed.html

but the “Disk Used” size hasn’t changed! and the cached data still the old
data. here is the response:

  • About to connect() to 127.0.0.1 port 8080 (#0)
  • Trying 127.0.0.1… connected
  • Server auth using Basic with user ‘admin’

POST /geoserver/gwc/rest/seed/workspace:layer.xml HTTP/1.1
Authorization: Basic YWRtaW46Z2Vvc2VydmVy
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1
zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Host: 127.0.0.1:8080
Accept: /
Content-Length: 12
Content-Type: application/x-www-form-urlencoded

  • upload completely sent off: 12out of 12 bytes
    < HTTP/1.1 500 Internal Server Error
    < Server: Apache-Coyote/1.1
    < Transfer-Encoding: chunked
    < Date: Wed, 30 Apr 2014 10:31:28 GMT
    < Connection: close
    <
  • Closing connection #0
    : Premature end of file.


View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Shadin,

The task is the process of creating tiles. It runs over the tiles you specify, putting them into the cache, and then stops when it’s covered them all. Killing it will have no effect on tiles it has put into the cache. They will still be disk, and will still be served up when requested until/unless they expire.

···

If you are doing mass updates to the data on a fixed schedule, you could use a Truncate (Clear tiles from the cache) or Reseed (Load fresh tiles into the cache) task, or maybe both depending on zoom level.

On 30 April 2014 04:35, Jonathan Moules <jonathanmoules@anonymised.com> wrote:

Hi Shadin,
Are you sure you want to be using tiles when the data updates every two hours? That seems like massive overkill unless you’re running a service with absolutely loads of users and usage (and even then…).
Tiles are best used for baselayers that change rarely (i.e. OpenStreetMap, google maps)

You may be better served simply setting the Response Cache Headers timeout to 2hrs (7200 seconds) on whatever layers you require it for.

http://docs.geoserver.org/stable/en/user/webadmin/data/layers.html

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Kevin Smith

Junior Software Engineer | Boundless

ksmith@anonymised.com

+1-778-785-7459

@boundlessgeo

Cheers,
Jonathan

On 30 April 2014 12:09, Shadin <shadin__a@…95…> wrote:

In my web application, i wanted a service to cache updated data using
geowebche. so i worked on seeding tiles automatically with GeoWebCache as in
this post:
http://gis.stackexchange.com/questions/87728/custom-time-interval-for-geowebcache/87804#87804

I see that the “Disk Used” of the layer in “Tile Caching” has been increased
to 50 MB. i also replaced wms with gwc/service/wms in layer requesting in
OpenLayers.

My data is updating every 2 hours. So i thought i have to terminate the
request and create a new one every 2 hours. “scheduled task”

I tried this kill request:

curl -v -u geowebcache:secured -d “kill_all=all”
http://localhost:8080/geowebcache/rest/seed/workspace:layer.xml

as in the last section here http://geowebcache.org/docs/1.5.1/rest/seed.html

but the “Disk Used” size hasn’t changed! and the cached data still the old
data. here is the response:

  • About to connect() to 127.0.0.1 port 8080 (#0)
  • Trying 127.0.0.1… connected
  • Server auth using Basic with user ‘admin’

POST /geoserver/gwc/rest/seed/workspace:layer.xml HTTP/1.1
Authorization: Basic YWRtaW46Z2Vvc2VydmVy
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1
zlib/1.2.3.4 libidn/1.23 librtmp/2.3
Host: 127.0.0.1:8080
Accept: /
Content-Length: 12
Content-Type: application/x-www-form-urlencoded

  • upload completely sent off: 12out of 12 bytes
    < HTTP/1.1 500 Internal Server Error
    < Server: Apache-Coyote/1.1
    < Transfer-Encoding: chunked
    < Date: Wed, 30 Apr 2014 10:31:28 GMT
    < Connection: close
    <
  • Closing connection #0
    : Premature end of file.


View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Jonathan,

Thanks for this tip! yes I thought it would be massive bit didn't know there
is another option.
So I just simply sit the timeout to 2 hrs and serve the layers using WMS as
usual? because i did that turning on ‘Response Cache Headers’ and look at
the HTTP response header on the client I see no difference from the case
when the ‘Response Cache Headers’ is not on.

How can i tell if it's working?
Thanks a lot!

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944p5138059.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Kevin,

Thank you I get it now.
tho I'm considering using 'Response Cache Headers' as in Jonathan's
suggestion. Have you used it before?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944p5138060.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Shadin,

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

If it is a layergroup then all layers within the group need to have that enabled and a value set, otherwise there are no headers set.

This layer for example has a cache set for a month:
http://maps.warwickshire.gov.uk/gs/ows?LAYERS=Public_Data_DB%3AOS_BD_COUNTY_WSHIRE&TRANSPARENT=TRUE&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A27700&BBOX=355450,207000,504550,333000&WIDTH=852&HEIGHT=720

If you look at the headers you’ll see:

Cache-Control max-age=2592000, must-revalidate
Content-Disposition inline; filename=Public_Data_DB-OS_BD_COUNTY_WSHIRE.png
Content-Length 15597
Content-Type image/png
Date Thu, 01 May 2014 08:09:36 GMT
Expires Sat, 31 May 2014 08:09:36 GMT
Server Microsoft-IIS/7.5
Set-Cookie GS_FLOW_CONTROL="GS_CFLOW_-7b4803d0:145b6296c7c:-7540"; Version=1
X-Powered-By [ASP.NET](http://ASP.NET)

I think I may have had to set something on my web-server too (which is acting as a reverse proxy between geoserver and the world) but it has been a while.

Cheers,
Jonathan

On 30 April 2014 20:28, Shadin <shadin__a@anonymised.com> wrote:

Hi Jonathan,

Thanks for this tip! yes I thought it would be massive bit didn’t know there
is another option.
So I just simply sit the timeout to 2 hrs and serve the layers using WMS as
usual? because i did that turning on ‘Response Cache Headers’ and look at
the HTTP response header on the client I see no difference from the case
when the ‘Response Cache Headers’ is not on.

How can i tell if it’s working?
Thanks a lot!


View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944p5138059.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Thanks Jonathan,

So I checked "Response Cache Headers" on the layer "single layer"
and here is the headers:

*Cache-Control:max-age=7200*
Content-Disposition:inline; filename=mylayer.png
Content-Type:image/png
Date:Sun, 04 May 2014 07:10:18 GMT
ETag:5cb34bee2f4f3c921f89f92d3bdb5e01
geowebcache-cache-result:HIT
geowebcache-crs:EPSG:900913
geowebcache-gridset:EPSG:900913
geowebcache-layer:mylayer
geowebcache-tile-bounds:12523442.712499999,2504688.5425000004,15028131.254999999,5009377.085000001
geowebcache-tile-index:[13, 9, 4]
Last-Modified:Sun, 04 May 2014 07:06:05 GMT
Server:Apache-Coyote/1.1
Transfer-Encoding:chunked
Jonathan Moules-2 wrote

I guess it's working.. right?

Also, I found this post about "Direct integration with GeoServer WMS"
http://docs.geoserver.org/2.2.4/user/webadmin/tilecache/defaults.html#webadmin-tilecaching-defaults

Do you think it will be useful in my case?
Hi Shadin,
   If it is a layergroup then all layers within the group need to have
that
enabled and a value set, otherwise there are no headers set.

This layer for example has a cache set for a month:
http://maps.warwickshire.gov.uk/gs/ows?LAYERS=Public_Data_DB%3AOS_BD_COUNTY_WSHIRE&TRANSPARENT=TRUE&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A27700&BBOX=355450,207000,504550,333000&WIDTH=852&HEIGHT=720

If you look at the headers you'll see:

*Cache-Control*max-age=2592000, must-revalidateContent-Disposition
inline;
filename=Public_Data_DB-OS_BD_COUNTY_WSHIRE.pngContent-Length15597
Content-Typeimage/pngDateThu, 01 May 2014 08:09:36 GMT *Expires*Sat, 31
May 2014 08:09:36 GMTServer
Microsoft-IIS/7.5Set-CookieGS_FLOW_CONTROL="GS_CFLOW_-7b4803d0:145b6296c7c:-7540";
Version=1 X-Powered-ByASP.NET

I think I may have had to set something on my web-server too (which is
acting as a reverse proxy between geoserver and the world) but it has been
a while.

Cheers,
Jonathan

On 30 April 2014 20:28, Shadin &lt;

shadin__a@

&gt; wrote:

Hi Jonathan,

Thanks for this tip! yes I thought it would be massive bit didn't know
there
is another option.
So I just simply sit the timeout to 2 hrs and serve the layers using WMS
as
usual? because i did that turning on 'Response Cache Headers' and look at
the HTTP response header on the client I see no difference from the case
when the 'Response Cache Headers' is not on.

How can i tell if it's working?
Thanks a lot!

--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944p5138059.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform
available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Geoserver-users mailing list

Geoserver-users@anonymised.com

https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
This transmission is intended for the named addressee(s) only and may
contain confidential, sensitive or personal information and should be
handled accordingly. Unless you are the named addressee (or authorised to
receive it for the addressee) you may not copy or use it, or disclose it
to
anyone else. If you have received this transmission in error please notify
the sender immediately. All email traffic sent to or from us, including
without limitation all GCSX traffic, may be subject to recording and/or
monitoring in accordance with relevant legislation.

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform
available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Geoserver-users mailing list

Geoserver-users@anonymised.com

https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944p5138446.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

okay what happened is that the layer is cached like forever. id doesn't
update each 2 hours. any idea?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944p5138464.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,
It doesn’t look like the “expires” header is being set. Is this a direct request or is it going through a proxy? If the later, maybe that’s altering your headers and removing it? I remember it require a little fiddling around to get it working for me.

Regards,
Jonathan

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

On 4 May 2014 10:32, Shadin <shadin__a@anonymised.com> wrote:

okay what happened is that the layer is cached like forever. id doesn’t
update each 2 hours. any idea?


View this message in context: http://osgeo-org.1560.x6.nabble.com/Terminate-GeoWebCache-REST-API-Request-tp5137944p5138464.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


“Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free.”
http://p.sf.net/sfu/SauceLabs


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users