BrandOriented / PimcoreCiHubConnector

This bundle adds full integration between Pimcore and CI-HUB Connector. Now you can add, delete and download all assets, lock and unlock, get all versions for specified asset and much more.
https://brandoriented.io/
Other
5 stars 6 forks source link

Image preview not updated immediately after update in Pimcore #43

Closed betterapp closed 5 months ago

betterapp commented 5 months ago

Pimcore version(s) affected

11

Description

We have some images in Pimcore Assets.

When we upload new version of the image or publish some other version from versions tab the image is updated in Pimcore. Request image data also have new version image content. image

But in asset list panel in CI-HUB in InDesign I see old images. image

They are refreshed after about 5 min. Why they are not refreshed immediately after reload folder ?

How to reproduce

  1. Upload some images under Pimcore
  2. Load them in CI-HUB panel under InDesign
  3. Upload new image version for one image.
  4. Reload image list in CI-HUB in InDesign.

Possible Solution

No response

Additional Context

No response

labudzinski commented 5 months ago

@betterapp

On the RestHelperTrait, we have a function to cache headers for thumbnails, which is used on the DownloadController on line 229.

`protected function addThumbnailCacheHeaders(Response $response): void { $lifetime = 300; $dateTime = new \DateTime('now'); $dateTime->add(new \DateInterval('PT'.$lifetime.'S'));

    $response->setMaxAge($lifetime);
    $response->setPublic();
    $response->setExpires($dateTime);
    $response->headers->set('Pragma', '');
}`
github-actions[bot] commented 5 months ago

Thank you for reporting this problem!

This is an open source project, and we rely on the community to help us diagnose and fix issues, as it is not possible to investigate and fix every issue reported to us via GitHub.

If possible, please create a pull request that fixes the problem you describe, along with appropriate tests. All pull requests will be promptly reviewed by the BrandOriented team.

Thank you very much!

betterapp commented 5 months ago

ok