Coder Social home page Coder Social logo

how to handle image cache ? about cfadmin HOT 9 CLOSED

cfadmin-cn avatar cfadmin-cn commented on June 15, 2024
how to handle image cache ?

from cfadmin.

Comments (9)

CandyMi avatar CandyMi commented on June 15, 2024

@gcclua
For example: You want to download a cached static file (js/css/png) when the browser first accesses the cf web server. It can be read locally when the second access is made, right?

I am not sure if I know what you mean.

from cfadmin.

gcclua avatar gcclua commented on June 15, 2024

yeah, I mean first accesses is too slow, about use 7~8 second to load 10 png, disk read problem

from cfadmin.

CandyMi avatar CandyMi commented on June 15, 2024

If the disk itself is slow to read, I recommend that you migrate the static files to a separate server. This will alleviate this problem.

Although cf can notify the client to cache static files, this can not solve the problem of low efficiency of the disk itself.

from cfadmin.

CandyMi avatar CandyMi commented on June 15, 2024

@gcclua
If the static file read speed is normal, we can set the ttl parameter of the httpd:static(folder, ttl) method, so that each client does not need to request it again during the ttl period after the last request for the static file.

from cfadmin.

gcclua avatar gcclua commented on June 15, 2024

I want to find a way, set framework to cache some png into server's memory, keep about 10240 png that will be frequent access

from cfadmin.

gcclua avatar gcclua commented on June 15, 2024

If httpd server preload/cache static folder that user set before bootstrap, and check cache when receive the hit request for the cache url/image,

from cfadmin.

CandyMi avatar CandyMi commented on June 15, 2024

@gcclua
cf does not implement this feature, you can only try other ways. : )

from cfadmin.

CandyMi avatar CandyMi commented on June 15, 2024

@gcclua
On the dev branch, I try to use 'sendfile' to improve the performance of the file being sent. Using zero-copy may be better than the original implementation.

I don't know if this will help you solve the problem you're experiencing, but at least it will effectively reduce the memory fluctuations caused by sending Lua large files.

If you have time, you can try to pull the dev version for testing.

from cfadmin.

gcclua avatar gcclua commented on June 15, 2024

OK,thanks,I will try

from cfadmin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.