ASP.Net 3.5网站项目VS Web应用程序项目
我有一个有趣的场景: - 网站有 209,000 多个页面。 - 每当用户提交新文章/项目时,都会生成一个新页面,如果它引用了现有页面之一,那么该页面也会重新生成并保存。 - Windows 服务正在处理页面的生成,该页面在站点目录中创建页面(文件)。 - 预生成页面的目的是保存从数据库请求的数据,因为 75% 的数据永远不会更新,并且在 FS 上拥有预生成的文件可以节省处理和内存。
它一直工作得很好,但我们现在担心...
问题是磁盘空间即将耗尽,如果我们重新启动服务器,则站点需要一段时间才能编译和运行,并且随着容量的增加,我们认为这将导致我们严重的问题问题。
有没有办法在预编译站点的同时我们仍然可以生成页面? (生成的页面全部继承自一个类,并且它们具有自定义控件)
有什么建议吗?
I have an interesting scenario: - Site has 209,000+ pages. - Evertime a user submits a new article/item a new page is generated and if it has a refernece to one of the existing pages then that page is also re-generated and saved. - A windows service is looking after the generation of pages which creates a page(file) in the site directory. - The purpose of pre-generated pages was to save requesting data from the database as 75% times data will never be updated and having a pre-generated file on the FS saves processing and memory.
It has been working very well but we are concerned now...
The problem is the disk space is running out and if we restart the server it takes a while for site to compile and run and as volume increases we think this will cause us serious problems.
Is there a way to have pre-compiled site and we can still generate pages? (the generated pages all inherit from one class and they have custom controls)
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当页面数量很大时,使用页面来存储内容总是会产生问题。由于所有页面都托管在网络服务器中,因此在不久的将来您可能会遇到问题。也许您可以考虑使用 WCM(Web 内容管理)应用程序而不是自动页面生成。
回答你的问题,我相信你可以从一个类继承(从预编译的预生成的页面),但我认为你不会预编译新页面。只是为了强调这是一个猜测,因为我从未做过类似的事情。
Using pages to store the content will always create a problem when the number of pages is big. Since all the pages are hosted in the web server, in a near future you could have a problem. Maybe you could consider to use a WCM (Web Content Management) application instead of automatic page generation.
Answering you question, I believe you can inherit from one class (from pre-compiled pre-generated pages), but I think you will NOT have the new page pre-compiled. Just to highlight this is a guess, because I never did something like that.
真正的问题是“项目类型”,即“网站”项目。
该网站项目使用 codedom 启用了动态编译,这就是为什么它也有 App_code 文件夹,该文件夹在“Web 应用程序”类型项目中不起作用。
每当有人访问它们时,所有生成的页面都会被编译。自从这个问题以来,我已经转换为 Web 应用程序并取得了良好的效果。
The real problem was "Project type" which was "Web Site" Project.
The web site project has dynamic compilation enabled using codedom, thats why it has App_code folder also which does not work in "Web Application" type Projects.
All the generated Pages where getting compiled whenever someone visited them. Since this issue I have converted to Web Application and have good results.