[DX Calendar][Contest Calendar] Backend optimization #2633
+351
−89
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RSS Feed Caching for DX Calendar and Contest Calendar
Description
This PR implements a cron-based RSS feed caching system for the DX Calendar and Contest Calendar pages, following the existing pattern for other cron jobs.
Why?
Cleaner architecture and most imporant - posibility to quickly display part of the data in other parts of the website in the future. As a side benefit - on my test instance DX Calendar load time was reduced from 7s to 1.5s.
Problem
Previously, both calendar pages fetched RSS data from external sources (ng3k.com and contestcalendar.com) on every page load. This caused:
Solution
Backend RSS Feed Caching
update_rss_feeds) that runs every 12 hours to fetch and cache RSS feeds - this can be simply improved to add more RSS sources in the future/tmp/.update_rss_feeds_running) to prevent concurrent executions - following other cron jobsDX Calendar Performance Optimization
get_batch_dxcalendar_statuses()in Logbook_modelINclauses to check all callsigns/DXCCs at onceFrontend Improvements
Migration
Migration 268 adds the new cron job:
update_update_rss_feeds0 */12 * * *(every 12 hours)Testing
application/cache/