I have a pretty hefty view page which has been overridden with template files to produce a custom gantt chart for a long list of users. For each row of gantt data - the outputted html is cached to speed things up..

I've written a function which I call via drush that deletes the cached key:values from my custom cache table.

drush eval 'custom_tweaks_clear_cache_codes()'

The plan is to 1) flush the cache every morning via cron using this drush command. Then, 2) 'warm the cache' essentially request this page via command line to build the cache table up again.

The issue is, I could leave it and let the first user who views the page, take the hit so the cache gets built - but I can't allow this, the user needs to be an admin..

Essentially: I need a way to hit the page but as admin - which doesn't involve me loading the page every morning manually before the day starts.

Has anyone got any ideas?

1 Answer 1


Load the page via the cron (maybe 5 mins after deleting the cache) using wget. You'll need to set this up on the server as opposed to through the Drupal UI.

This won't hit the page as admin but I'm not sure what value that adds. You just need the caches to be built so hitting as an anonymous user will do this.

Also checkout hook_drush_command() for creating your own Drush functions (good tutorial here).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.