• Resolved Geraldo Pena Perez

    (@geraldopena)


    I have set a rule for my message to appear. It is something super simple. I set it from a given date (2022-07-01) at 9AM to 9PM, Mon to Fri. It repeats every week until the year 6000. Pretty standard stuff until now.

    I am using the code on my home page:

    [timed-content-rule id="15"]Tutors are online now[/timed-content-rule]

    This makes the loading time of the page go up to 10 seconds. Am I doing something wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    The way how server side rules work is to calulcate a list of possile date ranges and then check if the current date is in one of the date ranges or not. So if the rule is really until year 6000 then the plugin has to calculate about 200000 values (3978 years, 50 weeks per year) which may take a while.

    The calculation is done for future events as well to be able to show a list of projected dates/times in the backend.

    Please reduce the end date to a year which makes more sense like like 2100. This is still more or less “unlimited” since it is not very likely that your website will still be around exactly in this form in 78 years.

    I will also implement an internal limit to avoid too many values to be calculated since indeed it makes little sense to calculate dates for 1000 years into to the future.

    Thread Starter Geraldo Pena Perez

    (@geraldopena)

    I see. That fixed the issue.
    Isn’t there a way to set a rule ro work indefinitely all the time?
    Like let’s say, mondays and tuesdays, every week, for ever?

    Plugin Author Arno Welzel

    (@awelzel)

    No there is no option to say “indefinitely”. This may be added in future versions, but first the internal calculation procedure has to be fixed to limit the number of calculations needed even if one sets a date like year 6000.

    • This reply was modified 2 years, 4 months ago by Arno Welzel.
    Plugin Author Arno Welzel

    (@awelzel)

    Version 2.70 now contains a fix to limit the number of calculated date/time values, so you should now be able to even use year 6000 as the upper limit without any performance issues.

    Thread Starter Geraldo Pena Perez

    (@geraldopena)

    That is ok for me. Having a time rule that expires is a small price to pay for having such a wonderful functionality.

    Thank you for the great plugin by the way!

    Thread Starter Geraldo Pena Perez

    (@geraldopena)

    Thank you so much for the 2.70 fix. You really nailed it with it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Using the timed-content-rule affects page load time’ is closed to new replies.