mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
added max-age to cache control
This commit is contained in:
@@ -262,6 +262,30 @@ public abstract class AbstractManagerResource<T extends ModelObject,
|
|||||||
return createResponse(request, items);
|
return createResponse(request, items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getCacheMaxAge()
|
||||||
|
{
|
||||||
|
return cacheMaxAge;
|
||||||
|
}
|
||||||
|
|
||||||
|
//~--- set methods ----------------------------------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param cacheMaxAge
|
||||||
|
*/
|
||||||
|
public void setCacheMaxAge(int cacheMaxAge)
|
||||||
|
{
|
||||||
|
this.cacheMaxAge = cacheMaxAge;
|
||||||
|
}
|
||||||
|
|
||||||
//~--- methods --------------------------------------------------------------
|
//~--- methods --------------------------------------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -324,6 +348,7 @@ public abstract class AbstractManagerResource<T extends ModelObject,
|
|||||||
{
|
{
|
||||||
CacheControl cc = new CacheControl();
|
CacheControl cc = new CacheControl();
|
||||||
|
|
||||||
|
cc.setMaxAge(cacheMaxAge);
|
||||||
rb.cacheControl(cc);
|
rb.cacheControl(cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,6 +420,9 @@ public abstract class AbstractManagerResource<T extends ModelObject,
|
|||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
protected int cacheMaxAge = 1;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
protected Manager<T, E> manager;
|
protected Manager<T, E> manager;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
|
|||||||
initComponent: function(){
|
initComponent: function(){
|
||||||
|
|
||||||
var repositoryStore = new Sonia.rest.JsonStore({
|
var repositoryStore = new Sonia.rest.JsonStore({
|
||||||
|
id: 'repositoryStore',
|
||||||
proxy: new Ext.data.HttpProxy({
|
proxy: new Ext.data.HttpProxy({
|
||||||
url: restUrl + 'repositories.json',
|
url: restUrl + 'repositories.json',
|
||||||
disableCaching: false
|
disableCaching: false
|
||||||
|
|||||||
Reference in New Issue
Block a user