• Resolved scmsteve

    (@scmsteve)


    Would you consider adding a filter call for the generation of the randomization string? Something like this:

    includes/class-super-light-cache-buster.php: ? ~line 525

    $random_number = apply_filters( ‘slcb_version_string’, wp_rand( 1000, 520000000 ) );

    We want to use this when we make a css change that browsers have a hard time letting go of, but we don’t want to totally disable caching. Hooking that filter would allow us to return a fixed string so it would reset older cached items but allow forward going caching to work until we changed the string again. This seems to be working in my testing, although I have only done a small amount so far.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter scmsteve

    (@scmsteve)

    Or, instead of random, if you decided to add the option to use a fixed string instead and have an option in settings to set that string… That would work as well. ??

    Plugin Author Mwale Kalenga

    (@mwalek)

    Hey @scmsteve,

    Thanks so much for the great suggestions!

    I think this feature would be useful to many other users, so I should implement it in the very near future. ??

    Will update you here when the new release is available.

    If the plugin is already useful for you, please also consider leaving a review. Thank you!

    Kind regards,
    Mwale

    Plugin Author Mwale Kalenga

    (@mwalek)

    Hey @scmsteve,

    I released v1.4.0 today which has the requested changes, both of them. ??

    There is an option to change the version number on the settings page, but you can override that setting programmatically using the filter slcb_version_name if you like.

    When using the filter, simply return the desired asset version name (or number).

    Please have a look and let me know if the changes meet your needs. Thanks!

    Kind regards,
    Mwale

    Thread Starter scmsteve

    (@scmsteve)

    This is excellent work! Thank you so much! Now we could have a fixed string that can be updated by any site admin when they want to “reset” the caching or have it programmatically controlled so some external condition could change it. This adds an incredible amount of flexibility for us. Thank you for implementing it!

    Plugin Author Mwale Kalenga

    (@mwalek)

    Hey @scmsteve,

    Amazing, thanks a lot for confirming that the changes are what you needed!

    If you notice any issues or have any other requests, please do reach out again.

    And if you are happy with the plugin, please also consider leaving a positive rating. That would be highly appreciated!

    Take care!

    Kind regards,
    Mwale

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Request: filter for version string?’ is closed to new replies.