Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Dec 01, 2016 @ 20:05
    Michaël Vanbrabandt
    0

    Store dynamic images ( barcode renders ) into a cache folder

    Hi all,

    for a project we need to print a coupon page that contains barcode image that is rendered based on the company name.

    Now every time the coupon page is called to print the rendering takes place.

    Now we want to store the rendered image so that it doesn't have to do this everytime.

    Can we use some umbraco cache technology to store images and remove them when the name is changed in the backoffice?

    Any ideas or suggestions?

    /Michaël

  • Jonathan Richards 288 posts 1742 karma points MVP
    Dec 05, 2016 @ 15:30
    Jonathan Richards
    100

    Hi,

    Most of my ideas involve hooking into the publishing event.

    So for example:-

    Whenever a content node of the correct type is published, execute your create barcode image code and save the resultant file to /images/barcode/{id}.jpg where id is the content node id of the new content.

    Then whenever you wish to render the bar code, you know its called /images/barcode/{id}.jpg

    This means that only when the content node changes do you create a new barcode, so for all page requests the barcode image is 'cached'.

    Cheers

Please Sign in or register to post replies

Write your reply to:

Draft