Description | Security | Documentation | Customization | Usage | Tips and Techniques | Compatibility With Other Macros | Macros known to not work with the cache macro | Other information | Cache Flushing | Screenshots | Release history
|
Additions and corrections to above
| JVM requirements | Java 1.4 and above |
|---|---|
| Installation requirements | |
DescriptionAllows cache control of page-level elements. Caches the rendered contents of the body of this macro. Very useful when using macros that might be slow to render content, but where it does not really need to be dynamically generated for each and every request. Specifically, this can improve performance for accessing dynamic data from sql, excel, and similar macros. Cache will be refreshed if the body of the macro changes or if attachments to this page have been added, removed, or have newer versions. The cache applies to all users that view this page. Based on OSCache. |
Reviews and more informationSecurityThis macro can be restricted to trusted users by configuring security using the Macro Security Plugin. |
Documentation
- Help available in the notation guide.
Parameters
- refresh - Cache refresh period. Default is a day. A number will be treated as seconds. A number followed by one of the following characters will be treated as follows:
- s - seconds.
- m - minutes.
- h - hours.
- d - days.

Any data after a s, m, h, or d is ignored. For example, 10days is the same as 10d or 10 days.
- cron - Cron-like expression for finer grained expiration. See Cron Expressions.
- showRefresh - Show a refresh icon if showRefresh=true. Default is false. When the refresh icon is clicked, the cache for this macro will be discarded forcing the data to be regenerated.
- showDate - Show the date and time that data was generated if showDate=true. Default is false. The date field follows the refresh icon and before the data.
- checkAttachments - Default is true. If true, the cache will be refreshed if there is any change in the attachments on this page. This includes adding, removing, or changing the version of any attachment. For instance, if you are caching the rendering of the an excel spreadsheet, then the data will be refresh if the attached spreadsheet is updated.
- title - Title to show when mouse is over the refresh icon. Default is "Refresh".
Customization
- For normal usage, properties do not need to be changed.
- Properties for the cache behavior are specified in .../WEB-INF/classes/oscache.properties.
- The properties file ships with Confluence and applies to the cache macro and other components using the defaults for the OSCache support. The default is:
cache.memory=true cache.capacity=100
- The capacity property equal to 100 means that 100 distinct renderings of the cache macro will be cached. Additional distinct renderings will replace previously cached entries. You should increase the capacity only if you used the cache macro in many places (over 100) that are accessed regularly and the extra JVM memory used will be acceptable.
Usage
{cache}
Something to cache for a day
{cache}
{cache:refresh=30m}
This will be cached for 30 minutes
{cache}
{cache:refresh=2 hours}
The excel data will be cached for 2 hours
{excel:file=^Report.xls}
{cache}
{cache:cron=30 * * * *|showRefresh=true|title=Refresh data from database}
This will be cached until 30 minutes past each hour of the day
{sql:dataSource=ReportDS}
select * from report
{sql}
{cache}
{cache:refresh=1d|showRefresh=true|showDate=true}
{beanshell}
System.out.println("Hello world " + (new Date()) );
{beanshell}
{cache}
Advanced Example
Tips and Techniques
Compatibility With Other Macros
Macros known to be allowed in the body of the cache macro
- SQL Plugin
- CSV Macro
- Beanshell Macro
- Groovy Macro
- Jython Macro
- Excel Plugin
- HTML Plugin
- XSLT Macro
- Jasper Report Plugin - with some exceptions for images
- Confluence Chart Plugin - see Site Statistics for examples.

Caching chart images
If you use the cache macro around the chart macro, you must use the attachment support provided by CHRT-38.
Macros known to not work with the cache macro
- {excerpt} - if the excerpt is defined within a cache, you will not be able to retrieve it's contents using the {excerpt-include} macro.

- Flowchart macro and other graphviz related macros
- Other macros that generate dynamic images
Other information
Cache Refresh
- To force all cache macros on a page to refresh, use a request attribute
- Example
http://localhost/display/SCRIPT/test?refresh=true
- Example
Cache Flushing
- To force all or portions of the entire cache to be flushed, use a request attribute on a page that uses the cache macro
- Example - all
http://localhost/display/SCRIPT/test?cache-flush=all
- Example - refresh first cache macro on page
http://localhost/display/SCRIPT/test?refresh=1
- Example - all
Screenshots
Release history
| Version | Date | State | License | Price |
|
|
23 Sep 2009 | Stable | Freeware / Open Source (BSD) | Free |
|
|
23 Sep 2009 | Stable | Freeware / Open Source (BSD) | Free |
|
|
24 Jun 2007 | Stable | Freeware / Open Source (BSD) | Free |
|
|
06 Oct 2006 | Stable | Freeware / Open Source (BSD) | Free |
|
|
26 Sep 2006 | Stable | Freeware / Open Source (BSD) | Free |
|
|
24 Sep 2006 | Prerelease | Freeware / Open Source (BSD) | Free |
Release Notes
- 3.2.0/3.2.1

Comments (84)
Jan 23, 2006
Awax says:
Wonderfull for the SQL macro !Wonderfull for the SQL macro !
Jan 23, 2006
Jason Dillon says:
I think it should be possible to add support to cache generated images too... co...I think it should be possible to add support to cache generated images too... could probably post-process the cached buffer, check for links, cache them and then use a new URL.
Aug 03, 2007
Bert Pluymers says:
Caching images would be a really nice feature. I am using the latex plugin, whi...Caching images would be a really nice feature. I am using the latex plugin, which sometimes makes pages slow to render, because it generates the png files again every page view, while the content is essentially static.
I installed the cache plugin specifically for use in combination with this plugin, so it would be nice if you could give the above suggestion a try.
Jan 23, 2006
David Peterson [CustomWare] says:
Nice macro(s) guys. I'm curious Bob, how do you generate an id automatically? Th...Nice macro(s) guys. I'm curious Bob, how do you generate an id automatically? The 'X'th {cache} macro on the page? What happens if an extra {cache} is at the top of the page? Will it stuff up the rest of the macros on that page?
Jan 23, 2006
Bob Swift says:
Yes, it will. And that could be prevented by an optional id parameter. But it i...Yes, it will. And that could be prevented by an optional id parameter. But it is just a cache, so it would just force a refresh. I would prefer that to requiring user to specify an id.
Jan 23, 2006
David Peterson [CustomWare] says:
Yeah, if a page edit forces a refresh that should be fine. I would also prefer t...Yeah, if a page edit forces a refresh that should be fine. I would also prefer to avoid an id if possible, and this seems like a reasonable solution here.
Jan 23, 2006
Bob Swift says:
With this implementation, a page edit does refresh anyway. However, the "body" ...With this implementation, a page edit does refresh anyway. However, the "body" changed support I have will be finer grained. But changing order will force refresh of those that are affected by the change.
Jan 23, 2006
Jason Dillon says:
I'm not sure how body changed support would work... seems like to detect that yo...I'm not sure how body changed support would work... seems like to detect that you need the body first, meaning you have to render, which defeats the purpose of the cache in the first place.
Got some magic I'm unaware of?
Jan 23, 2006
Jason Dillon says:
I had thought about doing some auto id generation, short of what is already done...I had thought about doing some auto id generation, short of what is already done... cache key is the spaceKey:pageName or spaceKey:pageName.id if an id attribute is given. Wasn't really sure if there was an easy way to auto-generate an id for multiple cache blocks... and make them predictable, so you could flush a cache'd block using cache-flush=entry=some_id.
That said, if there is an easy way to auto-generate an id, no reason not to add support for it IMO.
Jan 23, 2006
Guy Fraser says:
Atlassian are going to have a tough time judging the Codegeist!Atlassian are going to have a tough time judging the Codegeist!
Jan 23, 2006
Guy Fraser says:
Would it be possible to cache by group/user/privs using similar params to David'...Would it be possible to cache by group/user/privs using similar params to David's show-to and hide-from macros? That way you could still implement caching even for pages that contain content for mixed user groups by simply stating who the cache relates to?
Jan 23, 2006
Jason Dillon says:
You mean, like cache for anonymous = 1h and cache for confluence-administrators ...You mean, like cache for anonymous = 1h and cache for confluence-administrators = 5m or something like that? More control over the cache refresh period based on a user or group specification?
Jan 23, 2006
Bob Swift says:
It is possible to add more key values (like user) but not sure what group you co...It is possible to add more key values (like user) but not sure what group you could assign. User based cache would certainly limit the value of the cache - more cached data , overlow forcing refresh, and fewer hits. For groups, are you thinking of looping through all groups the specific user belongs to and see if there is a cache associated with that group name??? And what group would that rendering be associated with?? Certainly raises a lot of complications.
Feb 10, 2006
Guy Fraser says:
I've added some ideas to SCRP-54 I agree that per-user cache would in most case...I've added some ideas to SCRP-54
I agree that per-user cache would in most cases be fruitless, however for small companies (eg. 25 users on an intranet) it would be useful.
Jan 24, 2006
Guy Fraser says:
This macro owns! Even on normal pages that contain lots of wiki formatting (and ...This macro owns! Even on normal pages that contain lots of wiki formatting (and layout macros, etc) this macro gives a noticable improvement in speed.
Jan 24, 2006
Jason Dillon says:
Can you guys (or anyone) recommend a good approach to generating unique and cons...Can you guys (or anyone) recommend a good approach to generating unique and consistent identifiers for each cache macro in a single page (that would not be affected by page includes)? Its okay if the id's change on page edit, but short of that they should remain the same.
I've got a few ideas, but wanted to know if Atlassian had and recommended way.
Dec 01
Mike Cannon-Brookes says:
Jason - generating unique and consistent identifiers is hard, for a few reasons....Jason - generating unique and consistent identifiers is hard, for a few reasons. Firstly, the simplest way to generate unique identifiers is to add a value to the render context with each macro, which is then checked for and incremented if needed. This could simply be a counter, postfixed to the pagename or something like that.
The only problem I see with this strategy is that if someone edits the page and adds a new cache macro, you are in trouble. Previously cache regions 1, 2 and 3 now become regions 1, 2 and 4 (!) so the old cached content in the key for 3 will be wrong.
This may or may not be an issue though. Are all page edits going to flush the caches for a page? I would suggest that's a good idea. In which case, add an Event Listener to your plugin, listen for the PageUpdatedEvent and flush all your caches. This will mean that you can use a simple incremental scheme for numbering and should work AFAIK.
Jan 24, 2006
Bob Swift says:
We just need the counter, we can handle the other stuff. What do you mean "add ...We just need the counter, we can handle the other stuff. What do you mean "add a value to the render context". Maybe Jason knows what you mean, but I don't and I have some other macros to fix up with something similar. Thanks for helping!
Jan 24, 2006
Bob Swift says:
Never mind, Jason found the add/getParam. Do you guys know the dev kits java do...Never mind, Jason found the add/getParam. Do you guys know the dev kits java docs are incomplete/missing things (like RenderContext) for instance.
Jan 24, 2006
David Peterson [CustomWare] says:
Hey you're right! I hadn't noticed that addition before. Looking at the API docs...Hey you're right! I hadn't noticed that addition before. Looking at the API docs, it is a 2.0 addition, so if you use it the macro won't work prior to Confluence 2.0.
Jan 25, 2006
David Peterson [CustomWare] says:
As an adendum to this, the version of Utilities Plugin I just released (1.4.8/2....As an adendum to this, the version of Utilities Plugin I just released (1.4.8/2.0.2/2.1.2) has a new 'getContextParams()' method which uses the RenderContext.add/getParam methods in 2.0+ and fakes it with a Request Attribute in 1.4. This may be a reasonable way to get around the problem with 1.4, if you want to support that version of Confluence...
Jan 24, 2006
Jason Dillon says:
FYI, I'm only guessing that these methods will work as I think they will. Hopef...FYI, I'm only guessing that these methods will work as I think they will. Hopefully you can validate this for us with the updates to CacheMacro
Or maybe someone from Atlassian will tell us what's up.
Jan 24, 2006
Jason Dillon says:
Its not a problem when a page is added to add/remove cache macros, because when ...Its not a problem when a page is added to add/remove cache macros, because when the page commits the cache group for that page is flushed (or will be currently its not).
So, the page context that gets passed into the macro is the same for each page? Kinda like a page-level scope for attributes?
If so, that will work.
Jan 24, 2006
Jason Dillon says:
FYI, I think that we could use an event listener to handle the attachment checki...FYI, I think that we could use an event listener to handle the attachment checking/invalidation, which happens much less than page renders so it should speed things up.
I had thought about using an event listener to handle page change events, but not all pages have caches, and its simple enough to just do the version check invalidation in the macro.
Jul 17, 2006
Ryan Morgan says:
Great plugin! It also works with URL not specified. macros, which was giving u...Great plugin! It also works with URL not specified. macros, which was giving us fits on pages that had more than a few feeds.
Aug 24, 2006
Scott Farquhar says:
Just a heads up that as of 2.3, the cache macro may need to be rewritten to hand...Just a heads up that as of 2.3, the cache macro may need to be rewritten to handle clustering.
Bob / Jason - you may want to contact Confluence support - you may need to use Confluence's cache manager for caching (which replicates across the cache), rather than just having an in-memory cache.
Cheers,
Scott
Aug 25, 2006
Bob Swift says:
Scott, thanks for the info. I will look into this more later. Since it is just ...Scott, thanks for the info. I will look into this more later. Since it is just a cache, I would hope that the existing cache would still work although it would be limited to providing performance benefits only for subsequent requests on the local system.
Nov 01, 2006
Hubert Chen says:
I was able to work around the fact that cache does not work within chart which i...I was able to work around the fact that cache does not work within chart which is driven by SQL by adding in a separate data page and then doing an include on the page which generates the table from SQL.
So for my main page I do something like:
{chart:title=new chart|type=line} {include:Data Access Page} {chart}And then in a page called Data Access Page I do something like:
{cache:refresh=30m} {sql:jndi=datasource} select * from table {sql} {cache}This seems to have the desired result of a chart which is generated from cached SQL results. Of course the chart is still generated dynamically each request, but for my purposes, the SQL is the more expensive operation.
Hope that helps.
Jan 19, 2007
Bob Swift says:
With chart 1.7 there are now new options for working with cache.With chart 1.7 there are now new options for working with cache.
Jan 19, 2007
Ovidiu Todoran says:
Would it be feasible to add the data that is cached in the search? Perhaps have ...Would it be feasible to add the data that is cached in the search? Perhaps have a hash code of it, so the search index is not refreshed unnecessarily, but only when the data is actually changed.
I see this very useful with the sql macro. Just not sure where the "add_to_search_index" option would be better suited.
Jan 19, 2007
Bob Swift says:
Yes, I think it is feasible. I suppose if you had external data (like a query) ...Yes, I think it is feasible. I suppose if you had external data (like a query) that was valid for a period of time (monthly report) and you used it in combination with automation. I suggest you write up an issue for your requirement. Put it against the cache macro and it can be moved if necessary to a more appropriate place after we discuss it a bit more. The current Run macro and some improvements that are coming soon would also satisfy some of this. It enables the rendered data to be saved in an attachment which would automatically be indexed.
Mar 15, 2007
David Goldstein says:
Great plugin. While it gives a huge performance improvement when the data is ca...Great plugin. While it gives a huge performance improvement when the data is cached, as soon as it expires the next person who accesses the page gets "hit" with a major wait which the cache reloads (or if they explicitly do a refresh).
Any way to auto-refresh the page in the background (e.g. autorefresh every 20mins regardless of if page accessed at the time) so every 'n'th visitor doesn't experience severe reload pain?! Thanks.
Mar 15, 2007
Bob Swift says:
Although I haven't done this yet, my thought is to use [Confluence SOAP Clie...Although I haven't done this yet, my thought is to use [Confluence SOAP Client in Java] to render the page on whatever schedule you want. Schedule it using cron or windows scheduler. If you have more the one page, you could set up a master page that just includes all the other pages and schedule that. It could also be used on system startup to populate all those heavy pages. It would be something like:
Unfortunately, this will only force the cache to refresh if it has already expired.
Another option is to schedule an http driver command to run the http request with the refresh option (see example in the doc above). This will force the cache to refresh before it expires.
Mar 15, 2007
David Peterson [CustomWare] says:
Or, just use wget with the page name - that should force a render. If you get t...Or, just use wget with the page name - that should force a render.
If you get time in the future, it should be possible to create a 'job' plugin module which would get triggered by Confluene internally. But it wouldn't be too much fun setting up all the triggers...
Aug 03, 2007
Dan Hardiker says:
I've been trying to get a functional snapshot of the source, however when I comp...I've been trying to get a functional snapshot of the source, however when I compile I get an unresolved dependency: org.swift.confluence:scriptutil:jar:1.3.1
I can find the scriptutil-plugin but only up to version v1.3.0 ... any ideas?
Aug 03, 2007
Bob Swift says:
Sorry about that - some work still in progress. 1.3.0 is sufficient for this pl...Sorry about that - some work still in progress. 1.3.0 is sufficient for this plugin or you can use the newer script utilities that are renamed and relocated to http://svn.atlassian.com/svn/public/contrib/confluence/libraries/org.swift.confluence/jars/
Aug 13, 2007
Andy Brook says:
I don't see this plugin / category in the repository viewer, the title block ind...I don't see this plugin / category in the repository viewer, the title block indicates it should be there, is it grouped in another plugin or category? I'm installing it by hand anyway.
Aug 13, 2007
Dan Hardiker says:
What version of Confluence are you running?What version of Confluence are you running?
Oct 14, 2007
Stuart Gilberd says:
Has anyone else had problems with caching and charts in confluence 2.5.7?  ...Has anyone else had problems with caching and charts in confluence 2.5.7?
Cached charts used to work in 2.5.1 but now we get 404s when the cache is hit. ie when I first load the page the chart looks fine, but then refresh and hit the cache and the chart image is now a 404.
Oct 14, 2007
David Peterson [CustomWare] says:
I'm surprised that they worked prior to 2.5.7. Charts currently deletes the char...I'm surprised that they worked prior to 2.5.7. Charts currently deletes the chart graphic immediately after it is requested by the browser. As such, putting a cache around the outside of a {chart} macro is going to break. However, you should be able to put one inside the chart macro. Eg:
{chart} {cache} your dynamically generated table goes here... {cache} {chart}If that's what you're already doing, then yes, something seems to have broken in later versions of Confluence.
Oct 14, 2007
Bob Swift says:
The attachment supported added in 1.7 made it possible to save the image and wor...The attachment supported added in 1.7 made it possible to save the image and work with the cache macro around the chart macro. If there are problems with Confluence 2.5.7, I suggest Stuart create an issue and document his specific usage so that it can be tested.
Oct 18, 2007
Stuart Gilberd says:
Will do - thanksWill do - thanks
Oct 15, 2007
Bastian Widmer says:
Hi there I'm using Confluence 2.6.0 with the leftnavigation Theme. When i turn ...Hi there
I'm using Confluence 2.6.0 with the leftnavigation Theme. When i turn on the Cache Plugin it works like a charm, but the functions like Pages, Lables or Attachments won't work. Those links will end up in a blank page.
Is this a 'well known' error?
Thanks in advance
Bastian
Oct 15, 2007
Bob Swift says:
No, cache macro shouldn't have any affect on that. If you are sure it relates t...No, cache macro shouldn't have any affect on that. If you are sure it relates to the cache macro, document the scenario in an issue
Oct 18, 2007
David Dembo says:
Thought I'd run this past the experts before logging a feature request/bug repor...Thought I'd run this past the experts before logging a feature request/bug report to see whether or not it is possible...
Basically, I am using the {cache} macro in conjunction with the Reporting Plugin to speed up the performance of pages with multiple or complicated reports. This works beautifully in most cases I've found, except for one - if the information displayed in the report depends on the permissions of the person viewing it.
For example, I'm generating a customised 'Recently Updated' list:
I had an idea which might work - my question is basically whether it is possible/practical to make the cache macro cache and render different cached versions depending on the permissions of the user? E.g.:
Does this sound possible?
Oct 18, 2007
Bob Swift says:
I think the answer is yes, something related to this is possible but there might...I think the answer is yes, something related to this is possible but there might be difficulties figuring out exactly how to expose this. CACHE-3 is similar to what you are asking for. I think your use case is helpful in justifying this.
Oct 18, 2007
David Dembo says:
Updated with comments & voted. In retrospect, allowing users to explicitly ...Updated with comments & voted.
In retrospect, allowing users to explicitly specify conditions/versions would probably be a lot easier to implement and address 95% of security concerns anyway.
Oct 19, 2007
Doods Perea says:
Bob - our Confluence problem is actualy about cached attachments, where users st...Bob - our Confluence problem is actualy about cached attachments, where users still see the old version (by opening directly the document with a browser) even if a new one is already available. I have lodged this issue with Atlassian and after following the recommendation from this forum I thought the issue had been resolved. Some of our users just recently complained once more about this caching problem so I reactivated my issue with Atlassian support.
Could this plugin be the answer to our problem?
Thanks,
Oct 19, 2007
Bob Swift says:
No, this plugin will not help.No, this plugin will not help.
Feb 25, 2008
Jeff Branc says:
I'm using the cache plugin in conjunction with chart and sql. I have a lot...I'm using the cache plugin in conjunction with chart and sql. I have a lot of charts on a given page, so i'll use a number of caches to wrap each one individually. im hitting quite a large DB so the perf penalty for redoing the query is fairly high.
essentially, my page just has a series of cache/chart/sql tags. also, i want to do a manual refresh only, so i'm setting the expiration at 356d. this all normally works well, but there are a few anomolies i'd appreciate some insight on
1) when a new user goes to the page for the first time, everything is blank except for a series of those blue refresh arrows. clicking them causes the charts to show up one at a time. i would expect that when a new person hits the page it would either a) show them a cached page of charts or b) refresh everything. i do not understand why it just shows nothing but the refresh arrow. its very confusing to the user.
2) quite often when i have cache/sql sequences (no chart), with output=wiki, the resulting table has no table-plus features. its just a plain old table with no sorting/formating/etc. sometimes this works fine, creating the table-plus. often it does not. there is no real pattern i can figure out, except that it could be related to issue #1.
anyone else see this stuff? i'm using conf 2.7.1
Feb 25, 2008
David Peterson [CustomWare] says:
Probably this is due to the order you have the various macros in play here. For ...Probably this is due to the order you have the various macros in play here. For example, if you have a chart of SQL data the order should be:
{chart:...} {cache:..} {sql:...} ... {sql} {cache} {chart}If you have the {cache} outside the {chart} you will have problems due to the way that the chart plugin works (it generates a new image every time the user hits the page). There may be similar issues with the table-plus macro, but I'm less familiar with that plugin.
Feb 25, 2008
Bob Swift says:
What you describe should not happen if done correctly. Site Statistics has some ...What you describe should not happen if done correctly. Site Statistics has some examples. Hard to tell exactly without your markup. Suggest you create an issue with the details. David is right, the order is important. You can cache the chart generation as well, but that requires very specific chart parameters to save the chart as an attachment.
Feb 26, 2008
Jeff Branc says:
thanks for the help! i had the order wrong as you suspected. however,...thanks for the help! i had the order wrong as you suspected.
however, when i switched it to chart/cache/sql instead of cache/chart/sql, i started getting errors:
chart: com.atlassian.renderer.v2.macro.MacroException: org.dom4j.DocumentException: Error on line 3 of document : Open quote is expected for attribute "border" associated with an element type "img". Nested exception: Open quote is expected for attribute "border" associated with an element type "img".
removing 'cache' from the equation made the error go away, so there is something in the way cache wants to process the generated xhtml that is causing an issue.
here is the actual code:
{chart:title=Total Activity by Month|type=line|width=400|height=300|columns=2,3|showShapes=true|legend=false|displayData=false|dataOrientation=vertical|categoryLabelPosition=up45} {cache:refresh=7d|showRefresh=true|title=Refresh data from database} {sql:dataSource=SitelifeDW|output=wiki} select dm.Year as [Year], dm.Month as [Month], sum(cast(da.Count as bigint)) as [Total UGC] from DailyActivityFact da, DateDim dm where da.DateDimKey = dm.DateKey and dm.Date > getdate()-330 and dm.Date < getdate() group by dm.Year, dm.MonthOfYear, dm.Month order by dm.Year, dm.MonthOfYear, dm.Month {sql} {cache} {chart}Feb 26, 2008
Bob Swift says:
I can't reproduce that here, so if you can put the details in an issue and attac...I can't reproduce that here, so if you can put the details in an issue and attach the html source of the page. In the meantime, change showRefresh=false. That might be the problem and since you are not showing the chart data (dataDisplay=false), it will not appear anyway. And if that doesn't work, look at the attachment parameters for the chart plugin - these allow you to put cache around the chart.
Feb 26, 2008
Jeff Branc says:
well, interestingly enough the refresh arrow may be the thing causing the issue:...well, interestingly enough the refresh arrow may be the thing causing the issue:
i believe it should read more like
to fit in the strictest definition of XHTML. This does not explain why its not reproducible for others tho. but, getting rid of refresh made the problem go away.
Feb 26, 2008
David Peterson [CustomWare] says:
Yeah, having badly-formatted attributes would definitely cause problems. I'm als...Yeah, having badly-formatted attributes would definitely cause problems. I'm also unsure why nobody else would have had problems though. Also, it should probably end with '/>'. What version of Confluence/Cache/SQL are you using?
Feb 26, 2008
Bob Swift says:
I will fix in the next cache release which is coming soon anyway.I will fix in the next cache release which is coming soon anyway.
Feb 28, 2008
Matt Bovett says:
Is there any reason why the cache plugin can all of a sudden stop working? When...Is there any reason why the cache plugin can all of a sudden stop working?
When I use it and refresh a page, it doesn't use the cached content, it reloads it every single time.
Any ideas? (I am using just {cache}Some Content{cache}, which used to work – it cached for a day.)
Feb 28, 2008
Bob Swift says:
With that markup, it should cache for a day provided other use of cache macros o...With that markup, it should cache for a day provided other use of cache macros on your site have not caused it to be replaced earlier than desired (see customization notes). Unlikely in your case. Make sure that you are refreshing the page without any url parameters (like ?refresh=). Does it work sometimes or not at all now even though it worked before? If you are still having problems, create an issue with the details (versions, markup, etc...).
May 29, 2008
Lukas Karrer says:
The cache plugin is great! The only thing I miss is active pre-caching or au...The cache plugin is great! The only thing I miss is active pre-caching or auto-refresh. E.g. an agent which would refresh cached content automatically without any user involvement. This way, complex pages based on SQL or reports could be refreshed in the cache by the system during idle-time in the night and not by the first user using the page during busy day-time.
Am I missing something or would this be a feature request?
May 29, 2008
Bob Swift says:
Use the Confluence Command Line Interface render action in an over night script ...Use the Confluence Command Line Interface render action in an over night script to refresh cached values
. To make it easier to script this, you might define a single page that includes other pages. This makes maintenance of what gets refreshed just a page update instead of a script update.
May 29, 2008
Lukas Karrer says:
Thanks.. That will do.. Having it directly in the plugin would be somewhat easy...Thanks.. That will do..
Having it directly in the plugin would be somewhat easyier. So, if you ever have spare time
and looking for some way to extend the plugin, this would be a neat feature!
Cheers, Lukas
Jun 24, 2008
Dhana Lakshmi Marothu says:
we have used the code as below window.SyntaxHighlighter.config.clipboardSwf...we have used the code as below
{cache:checkAttachments=false} {attachments:sortBy=name} {cache}I am getting the below error:
Error formatting macro: attachments:org.springframework.jdbc.BadSqlGrammerException:Hibernate operation: could not insert: [com.atlassian.confluence.pages.Page#26019954]:bad SQL grammer[]:nested exception is com.microsoft.sqlserver.jdbc.SQLServerException:Snapshot isolation transaction aborted due to updated conflict. YOu cannot use snapshot isolation to access table 'dbo.CONTENT' directly or indirectly in database 'confluence' to update, delete or insert the row that has been modified or deleted by another transaction. Retry the transaction or change the osolation level for the update/delete statement.
Please let me know the cause for this error. I am getting this error intermittently. -Lakshmi
Jun 24, 2008
Bob Swift says:
The cache macro does not access the database directly. I suggest you report the...The cache macro does not access the database directly. I suggest you report the error to Atlassian support with a stack track.
Jul 03, 2008
Dhana Lakshmi Marothu says:
Thanks for your reply. First I reported to Atlassian support only. They redirect...Thanks for your reply. First I reported to Atlassian support only. They redirected me to this URL by saying that this is a third party plugin. Now I am in confusion to whom to report my issue.
-Lakshmi
Jul 03, 2008
Bob Swift says:
Well, the error is for the attachments macro. Try removing the cache macro and ...Well, the error is for the attachments macro. Try removing the cache macro and see if you still get the error, if you do, then submit your problem to Atlassian. If not, then create an issue for the cache macro and include the stack trace. Its unusual to use the cache macro around the attachments macro, do you have a page with a large number of attachments that does not perform well?
Jul 08, 2008
Mark says:
Can you cache iframe content and does this even make sense?Can you cache iframe content and does this even make sense?
Jul 08, 2008
Bob Swift says:
It caches the html produced by rendering the body of the macro - it doesn't know...It caches the html produced by rendering the body of the macro - it doesn't know or care what produced the html.
Sep 16, 2008
Kevin Ruscoe says:
I have just tried out the new indexing support in 3.2.0-beta and found it to wor...I have just tried out the new indexing support in 3.2.0-beta and found it to work extremely well. The site in which I am trialling the Cache plugin contains several hundred pages which consist almost entirely of SQL output (inventory information). So, searching the Confluence markup is next to useless, but searching the cached HTML works fine.
The new version has been in beta for a while. Do you plan to promote it to live status soon?
Cheers, Kevin
Sep 17, 2008
Bob Swift says:
Thanks for the feedback, that helps. While I don't have any specific problems re...Thanks for the feedback, that helps. While I don't have any specific problems reported with the code and we use it in production, I am unlikely to have any time for this until Nov.
Sep 17, 2008
Kevin Ruscoe says:
Ok, thanks Bob. (And I hope you don't mind my raising so many requests aga...Ok, thanks Bob. (And I hope you don't mind my raising so many requests against the Chart plugin :-) You seem to have plenty of code on your plate...)
Jan 06, 2009
Ben Shoemate says:
Love this plugin. Where is the cache stored? Is there a risk of overuse filling ...Love this plugin. Where is the cache stored? Is there a risk of overuse filling up memory - I'd like to know before I turn it loose on users.
Jan 06, 2009
Bob Swift says:
See the customization section above. By default, it is a memory store up to the...See the customization section above. By default, it is a memory store up to the 100 entries. You have complete control over the setting.
Feb 26, 2009
Moreno says:
Hello. I've got this problem with the macro: sometimes (very rarely) the body ...Hello.
I've got this problem with the macro:
sometimes (very rarely) the body of the macro, containing a user-defined macro and a link to another page is not rendered. What I get is an empty page with the link to the other page formatted like as the page doesn't exist (ex:['otherpage'])! It seems that the inner user defined macro is not executed, or its result not rendered...
Thanks
Mar 24, 2009
Bob Swift says:
You will need to narrow this down to a repeatable case and open an issue.You will need to narrow this down to a repeatable case and open an issue.
Mar 24, 2009
Yao Ge says:
Bob, Can you confirm that if a page edit action would force refresh all caches ...Bob,
Can you confirm that if a page edit action would force refresh all caches in the page? Thanks.
Mar 24, 2009
Bob Swift says:
No, it does not. Cache refreshes are based on the refresh parameter for each ca...No, it does not. Cache refreshes are based on the refresh parameter for each cache macro. If the content within a cache macro is edited, then that cache is invalidated and will be refreshed. If attachments are changed, then cache may be refreshed based on the checkAttachments parameter.
Mar 24, 2009
Yao Ge says:
Does it make sense to support an option for cache plugin to force refresh upon p...Does it make sense to support an option for cache plugin to force refresh upon page-edit event? It is typically assumed that when a page is updated, all of its content should be refreshed to reflected to latest state regardless if the actual edits are within the body of the cache macro or not.
Apr 22, 2009
Mike says:
Should the cache macro work with the jiraissues and jiraportlet macros? If I put...Should the cache macro work with the jiraissues and jiraportlet macros? If I put these within the cache macro, it simply shows a blank page.
Aug 03, 2009
Cameron Mosher says:
I've noticed that with Confluence 3.0, you can no longer have the cache macro li...I've noticed that with Confluence 3.0, you can no longer have the cache macro list the update time inline with other text.
For instance, we have several report tables using SQL that we cache and have the line:
"Last Updated: <date of last cache>"
However, in Confluence 3.0, an extra line break is always added so that it appears like this:
"Last Updated:
<date of last cache>"
Aug 03, 2009
Alain Moran says:
That's caused by the 'interesting' implementation decision made by atlassian whe...That's caused by the 'interesting' implementation decision made by atlassian when they implemented the new renderer. Rather than adding a new v3.BaseMacro class for new macros to extend and have the renderer behave as it used to for old BaseMacro derived macros, it was decided to take the easy way out and force the backwards compatibility implementation onto the people writing the macros.
As a result you will find lots of macros which work great with 2.10 suddenly do very odd things with 3.0 ... you will either need to wait for the plugin author to figure out a way to recode their macro so that it can be compatible with both 3.0 and previous releases of confluence, alternatively they may opt for ditching support for pre conf 3.0, or just maybe Atlassian may decide to change the way that the renderer works to allow it to be backwards compatible with older macros, while retaining the newly fixed isInline functionality for new macros specifically coded to take advantage of it.
Aug 03, 2009
Bob Swift says:
Alain is correct and the macro will be updated with this support next release. ...Alain is correct and the macro will be updated with this support next release. Please write up an issue.
Dec 03
Cameron Mosher says:
oops, I don't think I ever wrote up an issue for it, but the latest version stil...oops, I don't think I ever wrote up an issue for it, but the latest version still has this problem...
Dec 03
Bob Swift says:
My understanding is that Confluence changed and a plugin change is no longer req...My understanding is that Confluence changed and a plugin change is no longer required as least for subsequent Confluence releases. I tested this on 3.1-rc1 and it works correctly. It also seems to work correctly on Confluence 3.0.2 which was a surprise. Specifically: Last updated {cache:showDate=true|showRefresh=true} ... {cache} only produced 1 line. So, no changes are planned. Regarding the latest release, that was an Adaptavist change for a specific function and did not include any other changes. If further discussions are required, open an issue.