For starters, just to point out I have really gone through all posts here on this issue and none of the solutions are working for me.

I have a lot of GeoServer layers which I am serving in EPSG:3765 without a problem to my app. However, when I turn on caching using GeoServer integrated GWC, the trouble begins. I created a new gridset as in the image:

GeoServer Gridset settings

The pixel sizes I calculated by dividing the coordinate difference (e.g. X2-X1 or Y2-Y1, the result is the same) of tile bounds(from the http request params) at respective zoom levels with 256 and calculated the result on pow(-1). Maybe this is where I went wrong but adding normal zoom levels without any change hasn't done it for me either.
All my layer extents are set to SRID extent, my request is set to tile width and height 256. I think I am doing something wrong with defining pixel size /scale but for the life of me, I can't get it right. I also tried changing CRS extent to the one defined on SRS official page, hasn't made any difference. My projection and view are defined like this:

proj4.defs('EPSG:3765', "+proj=tmerc +lat_0=0 +lon_0=16.5 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs");

var htrs = ol.proj.get('EPSG:3765');

var view = new ol.View({center: [467500, 5101500],
projection: htrs,
minZoom: 7,
maxZoom: 20,
zoom: 12 });

All of my layers, have a 'TILED':true parameter. The error I am getting is

geowebcache-cache-result "MISS"  
geowebcache-miss-reason "request does not align to grid(s) 'grid_3765'"

I am a newbie at Geoserver, GWC and JavaScript and have no idea anymore what I could be doing wrong. Any solutions?

  • you need to add the code that creates your resolution array and tiled layer to the question - see openlayers.org/en/latest/examples/wmts.html for a working example
    – Ian Turton
    Sep 5, 2017 at 8:07
  • I did what you proposed, and got an error which said my projection had no recognized extent, so I set it accordingly to Geoserver extent bounds for EPSG:3765, which is different from the extent on spatialreference.org. Now my layer is miss aligned on zoom levels 0-5 with the occasional "column out of range" exception error. Caching seems okay for other zoom levels. I tried other combinations with the spatialreference.org bounds definition, emptying the cache on Geoserver and restarting caching, but it didn't work. Any other suggestions?
    – missmarkov
    Sep 10, 2017 at 19:58

1 Answer 1


I figured out the solution. My projection extent was wrong, which I realised by looking into the GWC GET request info in my web browser. I saw my extent was different from the one assigned to the tile for zoom level 0(0, 0, 0), read the new coordinates and assigned them to my projection extent and custom gridset. Now it works like a charm. By what I've read on some forums, it seems GeoWebCache and GeoServer have different extent value for some projections. I'm sorry my browsers language is Croatian, but you get the idea. Hope this helps someone.

GWC Get Request

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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