nils

I don't think the file is deleted for me though, but not 100% sure

nils

Yeah I got it, the File object is in draft stage but the actual file is deleted

nils

is $file->delete() supposed to only unpublish?

nils

Versioning 🤦‍♂️ disable-container: true

nils

i.e. can't set the cache after the response has been generated

nils

Why doesn't this work:

  1. $cache = Injector::inst()->get(CacheInterface::class . '.myCache');
  2. $cacheKey = "r6";
  3.  
  4. if ($cache->get($cacheKey)) {
  5. // Cached
  6. return new HTTPResponse('Cached', 400);
  7. } else {
  8. // Not cached
  9. $response = $delegate($request);
  10. $cache->set($cacheKey, "Cached");
  11. }
  12. return $response;

but this does:

  1. $cache = Injector::inst()->get(CacheInterface::class . '.myCache');
  2. $cacheKey = "r6";
  3.  
  4. if ($cache->get($cacheKey)) {
  5. // Cached
  6. return new HTTPResponse('Cached', 400);
  7. } else {
  8. // Not cached
  9. $cache->set($cacheKey, "Cached");
  10. }
  11. $response = $delegate($request);
  12. return $response;