DEV Community

Gerardo Andrés Ruiz Castillo
Gerardo Andrés Ruiz Castillo

Posted on • Originally published at geanruca.gitvlg.com

Tenant-Specific Scheduling in devlog-ist/landing

Introduction

In the devlog-ist/landing project, which likely involves a landing page generator with publishing capabilities, a key requirement is the ability to tailor content scheduling to individual tenants. This post explores how configurable publishing schedules were introduced to provide a more natural and less bot-like content delivery experience, enhancing the platform's flexibility and user experience.

The Challenge: Hardcoded Scheduling

Previously, the post scheduling mechanism relied on hardcoded values within the PostStaggeringService. This approach lacked the flexibility needed to accommodate the diverse needs of different tenants. All tenants were subject to the same rigid schedule, leading to potentially unnatural publishing patterns and a one-size-fits-all experience.

The Solution: Configurable Tenant Settings

The solution involved introducing configurable publishing schedule settings for each tenant. Specifically, tenants can now adjust the following parameters via the AutomationSettings page:

  • Publish Window Hours (Start/End): Define the time frame during which posts should be published.
  • Maximum Posts Per Hour: Control the density of posts published within the defined window.
  • Jitter Minutes: Introduce randomness to the exact publishing time, making the schedule less predictable and more organic.

Implementation Details

The hardcoded values in PostStaggeringService were replaced with these tenant-specific settings. This allows each tenant to customize their publishing schedule according to their preferences and audience behavior. For example, consider a hypothetical scenario where a tenant wants to publish content primarily during business hours, with a limited number of posts per hour and a slight variation in timing to avoid appearing robotic. The configuration might look like this:

$tenantSettings = [
    'publish_start_hour' => 9,
    'publish_end_hour' => 17,
    'max_posts_per_hour' => 3,
    'jitter_minutes' => 10,
];

// The PostStaggeringService would then use these settings to determine the
// appropriate time to publish each post.
Enter fullscreen mode Exit fullscreen mode

Benefits of Configurable Scheduling

  • Improved User Experience: Tenants can tailor content delivery to their specific audience, leading to higher engagement.
  • More Natural Publishing Patterns: The introduction of jitter and customizable windows prevents the appearance of automated bot-like behavior.
  • Increased Flexibility: The platform becomes more adaptable to the diverse needs of different tenants.

Conclusion

By introducing configurable publishing schedules, the devlog-ist/landing project has significantly enhanced its content delivery capabilities. This change provides tenants with the flexibility they need to create a more engaging and natural user experience, moving away from rigid, hardcoded schedules towards a more dynamic and personalized approach.

Top comments (0)