Making sure your plugin is CDN compatible

In Bitbucket Server 6.8 we have added CDN support for caching static assets(such as JavaScript, CSS, and fonts). This includes static resources that are served by plugins. With this change, we are moving to stateless delivery of JavaScript and CSS resources. Apps that don’t use the new APIs for web-resource transforms and conditions may cause static assets to be cached incorrectly.

The following web-resource transforms and conditions have been deprecated:

  • com.atlassian.plugin.webresource.transformer.WebResourceTransformer
  • com.atlassian.plugin.web.Condition

See Stateless web-resource transforms and conditions to make sure your app is using the new APIs for web-resource transforms and conditions.

3 Likes

@YingranSun - could you please detail how test and verify plugin/add-on/app compatibility with CDN caching?

As long as your plugin is not using the deprecated APIs listed above, it should be compatible with CDN, and the static assets will be cached correctly. You can check whether your plugin is compatible through the following steps:

  1. Install your plugin on a Bitbucket Server 6.8 DC instance
  2. Go to Administration —> Content Delivery Network
  3. If your plugin is not compatible with CDN, it will appear in the section “User-installed apps may not be compatible”:

    When there are no incompatible plugins, the health check will look like this:

You can see if your plugin is using deprecated APIs by also querying the following endpoint:
https://<instance-url>/rest/webResources/1.0/deprecatedDescriptors
This will tell you if your plugin is using either the deprecated WebResourceTransformer and/or Condition. If you are, you will need to remove them from the code.

1 Like