diff --git a/djangoldp/views.py b/djangoldp/views.py index f4453e425139b20f2bf6060ae9086601a6a58c64..0325411dc866123b21a7cbc4424712f689b43b02 100644 --- a/djangoldp/views.py +++ b/djangoldp/views.py @@ -1,6 +1,7 @@ import json import logging import os +import time import validators from django.apps import apps @@ -633,6 +634,13 @@ def serve_static_content(request, path): if not file_path.endswith('.jsonld'): file_path += '.jsonld' + if os.path.exists(file_path): + current_time = time.time() + file_mod_time = os.path.getmtime(file_path) + time_difference = current_time - file_mod_time + if time_difference > 24 * 60 * 60: + os.remove(file_path) + if not os.path.exists(file_path): resolver = get_resolver()