Commits

Anonymous committed 0a63e41

Avoid cron parsing if content is stale

Comments (0)

Files changed (1)

src/java/com/opensymphony/oscache/base/Cache.java

     protected boolean isStale(CacheEntry cacheEntry, int refreshPeriod, String cronExpiry) {
         boolean result = cacheEntry.needsRefresh(refreshPeriod) || isFlushed(cacheEntry);
 
-        if ((cronExpiry != null) && (cronExpiry.length() > 0)) {
+        if ((!result) && (cronExpiry != null) && (cronExpiry.length() > 0)) {
             try {
                 FastCronParser parser = new FastCronParser(cronExpiry);
                 result = result || parser.hasMoreRecentMatch(cacheEntry.getLastUpdate());