Opened 5 years ago

Closed 5 years ago

#2440 closed change (fixed)

[cms] Add support for cache files

Reported by: sebastian Assignee: sebastian
Priority: P3 Milestone:
Module: Sitescripts Keywords:
Cc: Blocked By:
Blocking: #2432 Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

Description (last modified by sebastian)


Currently, there is no place custom filters and globals can store persistent data. However, sometimes you need to cache some data (e.g. to prevent site generation from crashing when external resources aren't available). This currently the case with #2432.

What to change

Implement Source.get_cache_dir() to be used by custom filters and globals via contextfilter and contextfunction.

When the website is generated (or served with the development server) from a local directory get_cache_dir() should return the absolute path to the cache subdirectory under the website's root.

If the website is generated via Mercurial, /var/cache/<repo-path> should be returned on unix. Other platforms don't need to be considered for this case.

Change History (3)

comment:1 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 5 years ago by sebastian

  • Description modified (diff)

comment:3 Changed 5 years ago by sebastian

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.