Skip to main content
added another alternative option
Source Link
Vipin Kothari
  • 2.7k
  • 1
  • 11
  • 15

First of all you won't be able to change anything into broker db via API and I would recommend not to do it either. The only way changes should go into broker db is via publish.

Having said that, for client side cache busting you can implement something like the below:

  1. Option 1:

When any css file is added to cms or a reference is added in content, you can use datetime stamp as the version for the fully qualified url as a query string param. This can be easily done using event system.

  1. Option 2:

Alternatively if you refer CSS from an external system andor just have references which are fully qualified url's or relative url's, you can write a tbb to add datetime of modified time of the page/component as the cache buster to the url as a query string param during the publish process.

  1. Option 3:

If you are publishing the CSS files from Tridion and the application references the CSS and the need is to update the application references when the CSS is published, you can use a configuration component where you store the filename (CSS filename) and the datetime stamp and use it during the publish process to add the query string param for client side cache busting. The application will have to use this dynamic configuration component to update the references on wherever the CSS is referenced.

We use option 2similar approach and have been using it without issues.

First of all you won't be able to change anything into broker db via API and I would recommend not to do it either. The only way changes should go into broker db is via publish.

Having said that, for client side cache busting you can implement something like the below:

When any css file is added to cms or a reference is added in content, you can use datetime stamp as the version for the fully qualified url as a query string param. This can be easily done using event system. Alternatively if you refer CSS from an external system and just have references, you can write a tbb to add datetime of modified time of the page/component as the cache buster.

We use option 2 and have been using it without issues.

First of all you won't be able to change anything into broker db via API and I would recommend not to do it either. The only way changes should go into broker db is via publish.

Having said that, for client side cache busting you can implement something like the below:

  1. Option 1:

When any css file is added to cms or a reference is added in content, you can use datetime stamp as the version for the fully qualified url as a query string param. This can be easily done using event system.

  1. Option 2:

Alternatively if you refer CSS from an external system or just have references which are fully qualified url's or relative url's, you can write a tbb to add datetime of modified time of the page/component as the cache buster to the url as a query string param during the publish process.

  1. Option 3:

If you are publishing the CSS files from Tridion and the application references the CSS and the need is to update the application references when the CSS is published, you can use a configuration component where you store the filename (CSS filename) and the datetime stamp and use it during the publish process to add the query string param for client side cache busting. The application will have to use this dynamic configuration component to update the references on wherever the CSS is referenced.

We use similar approach and have been using it without issues.

Source Link
Vipin Kothari
  • 2.7k
  • 1
  • 11
  • 15

First of all you won't be able to change anything into broker db via API and I would recommend not to do it either. The only way changes should go into broker db is via publish.

Having said that, for client side cache busting you can implement something like the below:

When any css file is added to cms or a reference is added in content, you can use datetime stamp as the version for the fully qualified url as a query string param. This can be easily done using event system. Alternatively if you refer CSS from an external system and just have references, you can write a tbb to add datetime of modified time of the page/component as the cache buster.

We use option 2 and have been using it without issues.