Hi,

I am purposely returning to your original post to clarify what you need...


S P Arif Sahari Wibowo wrote:
> Here is why I am asking: I use Mason to create a colletion of 
> static pages from a set of components. This static pages will 
> then uploaded to the actual site. However, I would like to 
> minimize upload only for modified files only. The only way I can 
> think of is to save the generated content into a temporary file, 
> compare the temporary file with the existing page, and then 
> replace the page with the temporary file if there is any 
> difference. But obviously quite a work there.
>
> I am thinking about deciding to replace file based on last 
> modification time of the component. However, the components may 
> include other files and inherit from other components, and if 
> the other files or components were modified, the file should 
> still be generated. Hence my question above.
>   

So, you have two web sites:  A and B.  A uses Mason to generate *static* 
web pages and these web pages are uploaded to B.  I presume you are 
doing this because you want to use Mason, you are not the system 
administrator of B, and because of this, either cannot have Mason 
installed on B OR you don't want the system administrator of B to know 
your source.  Does this sound right?

Well, the intended purpose of Mason (note, I'm no Mason expert) is not 
what you are doing (though I understand your reasons for doing it).  
Basically, it sounds like what you want is the reverse:  Given a static 
HTML file, what are the components that generated it.  This is 
impossible to know unless you kept some bookkeeping information yourself 
in your static generation.  The reverse is also hard to know:  given a 
component, what other components use it.

What Alfie suggested sounds right, but based on your above message, it 
sounds like you have two separate problems:

1)  Should the static file be generated on your server (A).
2)  Should you update the *static* file on server B.

I think rsync, a date check or an md5sum check would solve problem #2.  
It sounds like your bigger problem is #1 and the reason is that (if I am 
interpretting your problem correctly) you aren't using Mason exactly as 
intended (generate pages in real-time).  (I'm curious how you generate 
the static pages...do you send a web crawler through your own server?  
I'm not ridiculing your situation -- I understand that if you aren't the 
system admin of B but want to use Mason, you have to be creative.)

So, I don't know if you like this idea, but how about writing a 
bookkeeping file using a script and the method suggested by Alfie?  
i.e., do what Alfie suggested, but write it out to a file.  And then use 
this file to determine if a static file on your server needs to be 
generated and sent out...

Ray

PS:  Sorry if I misunderstood your problem...




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to