모듈을 사용하여 ColdBox 응용 프로그램을 개발하고 있으며 캐싱 기능을 사용하여 일정 시간 동안보기를 캐시합니다.ColdBox 응용 프로그램에서 renderView()의 cacheTimeout 설정이 효과가없는 이유는 무엇입니까?
component{
property name="moduleConfig" inject="coldbox:moduleConfig:mymodule";
...
function widget(event, rc, prc){
var viewData = this.getData();
return renderView(
view = "main/widget",
args = viewData,
cache = true,
cacheSuffix = ":" & moduleConfig.entryPoint,
cacheTimeout = 2
);
}
}
나는 나의 Cachebox.cfc에 다음 정보를 추가하여 기본 캐싱 설정을 설정하기 위해 노력하고 위의 코드에서 cacheTimeout
제거 :
cacheBox = {
defaultCache = {
objectDefaultTimeout = 1, //two hours default
objectDefaultLastAccessTimeout = 1, //30 minutes idle time
useLastAccessTimeouts = false,
reapFrequency = 5,
freeMemoryPercentageThreshold = 0,
evictionPolicy = "LRU",
evictCount = 1,
maxObjects = 300,
objectStore = "ConcurrentStore", //guaranteed objects
coldboxEnabled = false
},
caches = {
// Named cache for all coldbox event and view template caching
template = {
provider = "coldbox.system.cache.providers.CacheBoxColdBoxProvider",
properties = {
objectDefaultTimeout = 1,
objectDefaultLastAccessTimeout = 1,
useLastAccessTimeouts = false,
reapFrequency = 5,
freeMemoryPercentageThreshold = 0,
evictionPolicy = "LRU",
evictCount = 2,
maxObjects = 300,
objectStore = "ConcurrentSoftReferenceStore" //memory sensitive
}
}
}
};
비록 어떤을하지 않았다 캐싱에 대한 영향. 또한 Coldbox.cfc에 위의 설정을 추가하려고했습니다.
내가 coldbox create app MyApp
를 통해 CommandBox를 통해 완전히 새로운 테스트 응용 프로그램을 만들 경우에도, 그 다음 1 분에 Cachebox.cfc의 캐싱을 설정, Coldbox.cfc에 viewCaching = true
을 설정하고 Main.cfc에 event.setView(view="main/index", cache=true)
을 설정, 그것은 아무튼 예상대로 작동하지 않습니다.
내가하는 일과 관계없이보기는 항상 최소 5 분 동안 캐시됩니다.
누락 된 것이 있습니까?
보기가 캐시되는 시간은 어떻게 확인합니까? –
이 질문은 CFML 여유 시간 팀에서 교차 게시 된 것이므로 거기에 답장을 보았습니다 (복제 할 수 없음). 귀하의 문제가 무엇인지 파악한 후, SO가 이전의 Q & A에 정말로 적합하므로 여기에서 답변을 업데이트 할 수 있습니다. –