python - Caching system for dynamically created files? -


I have a web server that is dynamically making different reports in different formats (PDF and doctor files). The files are required to be generated in a reasonable amount of CPU, and are quite common in situations where two people are making similar reports with the same input.

Input:

  • Version of the report creation tool
  • / ul>

    When a user tries to generate a report, I would like to check to see if a file exists with the already existing input, and if so If a file is not already available, then I would like to generate it as needed.

    1. What solutions are already present? I have cached simple HTTP requests before, but the keys are very simple (usually the database id)

    2. If I have to do this, then what is the best way to input several hundred words And I was thinking how I should go about changing the strings in the key sent in the cache.

      // The whole input uses a lot of memory, a mapping cache ['one two three four five six seven eight nine ten eleven ...'] / / low keys cache ['a'] => 5 results, then I should do it less

    3. Is there something that should be done in a database, or this better web app code (Python in my case) )

    Thank you to all.

This is Apache.

Create a directory that reports.

Configure Apache to serve files from that directory.

If the report is present, redirect to the URL that will serve Apache.

Otherwise, the report is not present, so create it then redirect to a URL that will serve Apache.


There is no "hashing" you have a key ("string (equations, numbers and word lists), arbitrary length, about 99% less than 200 words") and a value That's a file. Do not waste time on a hash You just have a long key.

You can make this key by making a "Slug" to a certain extent: Remove the punctuation, replace the empty space with _, the kind of thing.

You should create an internal surrogate key which is a simple integer.

You are simply translating a long key into a "report" that exists as a file or will be created as a file.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -